Skip to content

Commit

Permalink
Redesign (rooware-io#11)
Browse files Browse the repository at this point in the history
* Tailwindcss design from Steven
* Add some minor features to fit new design
  • Loading branch information
Arrowana authored Aug 7, 2021
1 parent 36e53d6 commit 5f9c70c
Show file tree
Hide file tree
Showing 16 changed files with 18,634 additions and 439 deletions.
11 changes: 11 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// craco.config.js
module.exports = {
style: {
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
}
17,489 changes: 17,489 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@craco/craco": "^6.2.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
Expand All @@ -18,6 +19,7 @@
"notistack": "^1.0.9",
"react": "^17.0.2",
"react-async-hook": "^3.6.2",
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
Expand All @@ -28,9 +30,9 @@
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "HTTPS=true react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start": "HTTPS=true craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject",
"deploy": "gh-pages -d build"
},
Expand Down Expand Up @@ -63,9 +65,13 @@
"@types/material-ui": "^0.21.8",
"@types/node": "^12.0.0",
"@types/react": "^17.0.5",
"@types/react-copy-to-clipboard": "^5.0.1",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.7",
"@types/react-virtualized": "^9.21.11",
"gh-pages": "^3.1.0"
"autoprefixer": "^9",
"gh-pages": "^3.1.0",
"postcss": "^7",
"tailwindcss": "npm:@tailwindcss/postcss7-compat"
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<title>Solstake</title>
</head>
<body>
<body class="font-body bg-gradient-to-br from-solblue-dark via-solblue-light to-solblue-dark">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
6 changes: 3 additions & 3 deletions src/components/DelegateDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export function DelegateDialog(props: {stakePubkey: PublicKey, open: boolean, ha
}
cellRenderer={(props: TableCellProps) => (
<img
height="60px"
style={{height: "65px"}}
src={props.cellData as string}
alt=""
/>)
Expand Down Expand Up @@ -320,7 +320,7 @@ export function DelegateDialog(props: {stakePubkey: PublicKey, open: boolean, ha
APY{' '}
<Tooltip title={<Typography>Stakeview.app APY averaged over last 3 epoch</Typography>}>
<Link href="https://www.stakeview.app" rel="noopener noreferrer" target="_blank">
<img height="30px" src="stakeviewapp.png" alt="" style={{verticalAlign: "middle"}}/>
<img className="inline" src="stakeviewapp.png" alt="" style={{verticalAlign: "middle", height: "30px"}}/>
</Link>
</Tooltip>
</Typography>
Expand Down Expand Up @@ -353,7 +353,7 @@ export function DelegateDialog(props: {stakePubkey: PublicKey, open: boolean, ha
<Typography>
Score (Max 11)
<Link href="https://validators.app/faq" rel="noopener noreferrer" target="_blank">
<img height="20px" src="va-logo.png" alt="" style={{verticalAlign: "middle"}}/>
<img className="inline" src="va-logo.png" alt="" style={{verticalAlign: "middle", height: "20px"}}/>
</Link>
</Typography>
)}
Expand Down
42 changes: 42 additions & 0 deletions src/components/Epoch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { useEffect, useState } from 'react';
import { useConnection } from '../contexts/connection';
import { DashboardEpochInfo, getDashboardEpochInfo } from '../utils/epoch';
import { formatPct, humanizeDuration } from '../utils/utils';

export default function Epoch() {
const connection = useConnection();
const [dashboardEpochInfo, setDashboardEpochInfo] = useState<DashboardEpochInfo | null>();

useEffect(() => {
setDashboardEpochInfo(null);
async function update() {
setDashboardEpochInfo(
await getDashboardEpochInfo(connection)
);
}
update();

const id = setInterval(update, 30000)
return () => clearInterval(id);
}, [connection]);

return (
<div className="h-full w-full mb-3 solBoxBlue">
<div className="p-5">
<p className='text-3xl uppercase'>Epoch {dashboardEpochInfo?.epochInfo.epoch}</p>
</div>
{/* Progress bar */}
<p className="pb-2 text-xl">{dashboardEpochInfo?.epochProgress && formatPct.format(dashboardEpochInfo.epochProgress)}</p>
<div className="mx-5 mb-2 bg-white rounded-full">
<div className="shadow w-full bg-grey-light">
<div className="bg-solacid rounded-full text-xs leading-none border-4 border-white py-1 text-center text-solblue-dark" style={{width: dashboardEpochInfo?.epochProgress && formatPct.format(dashboardEpochInfo.epochProgress)}}></div>
</div>
</div>
<p className="pb-3 text-xs text-solgray-light">estimated time remaining{' '}
<span className="font-bold">
{dashboardEpochInfo?.epochTimeRemaining && humanizeDuration.humanize(dashboardEpochInfo?.epochTimeRemaining)}
</span>
</p>
</div>
);
}
Loading

0 comments on commit 5f9c70c

Please sign in to comment.