diff --git a/client/src/App.jsx b/client/src/App.jsx index fad5d2e..e34f67d 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -4,6 +4,12 @@ import { import { useSDK } from '@metamask/sdk-react'; import { Web3 } from 'web3'; import Button from 'react-bootstrap/Button'; +import Tab from 'react-bootstrap/Tab'; +import Tabs from 'react-bootstrap/Tabs'; +import Container from 'react-bootstrap/Container'; +import Row from 'react-bootstrap/Row'; +import Col from 'react-bootstrap/Col'; +import Stack from 'react-bootstrap/Stack'; import DAOArtifact from './assets/DAO.json'; import work1Artifact from './assets/Work1.json'; @@ -391,173 +397,193 @@ function App() { {connected && ( <> -
- {!contracts[chainId] && ( -
- Please switch MetaMask to Sepolia testnet! -
- )} -
- {chainId && `Chain ID: ${chainId}`} -
-
- {`Account: ${account}`} -
-
- {`Balance: ${balanceEther} ETH`} -
-
- {`Your REP: ${reputation}`} -
-
- {`Total REP: ${totalReputation}`} -
- -
-
- {`Posts count: ${posts.length}`} -
-
- - - - - - - - - - - {posts.filter((x) => !!x).map((post) => ( - - - - - - - ))} - -
IDAuthorSenderActions
{post.id.toString()}{post.author}{post.sender} - Initiate Validation Pool - {' '} - - {' '} - - {' '} - -
-
-
- -
-
- {`Validation Pool Count: ${validationPools.length}`} -
-
- - - - - - - - - - - - - - - {validationPools.filter((x) => !!x).map((pool) => ( - - - - - - - - - + {!contracts[chainId] && ( +
+ Please switch MetaMask to Sepolia testnet! +
+ + )} + + + + + +
+ {chainId && `Chain ID: ${chainId}`} +
+
+ {`Account: ${account}`} +
+
+ {`Balance: ${balanceEther} ETH`} +
+
+ + + +
+ {`Your REP: ${reputation}`} +
+
+ {`Total REP: ${totalReputation}`} +
+
+ +
+
+ + + + + + +
+ {`Posts count: ${posts.length}`} +
+
+
IDPost IDFeeDurationEnd Time - Stake -
- Count -
StatusActions
{pool.id.toString()}{pool.postIndex.toString()}{pool.fee.toString()}{pool.duration.toString()}{new Date(Number(pool.endTime) * 1000).toLocaleString()}{pool.stakeCount.toString()}{pool.status} - {!pool.resolved && reputation > 0 && pool.timeRemaining > 0 && ( - <> -
+ + + + + + + + + + {posts.filter((x) => !!x).map((post) => ( + + + + + - - ))} - -
IDAuthorSenderActions
{post.id.toString()}{post.author}{post.sender} + Initiate Validation Pool + {' '} + {' '} - - )} - {!pool.resolved && pool.timeRemaining <= 0 && ( - - )} -
-
-
-

Work Contract 1

-
- {`Price: ${work1Price} ETH`} -
-
- Stake Availability: - {' '} - {!reputation && <>No reputation available to stake} - {reputation > 0 && ( - <> - + + {' '} + + + + ))} + + +
+
+ +
+
+ {`Validation Pool Count: ${validationPools.length}`} +
+
+ + + + + + + + + + + + + + + {validationPools.filter((x) => !!x).map((pool) => ( + + + + + + + + + + + ))} + +
IDPost IDFeeDurationEnd Time + Stake +
+ Count +
StatusActions
{pool.id.toString()}{pool.postIndex.toString()}{pool.fee.toString()}{pool.duration.toString()}{new Date(Number(pool.endTime) * 1000).toLocaleString()}{pool.stakeCount.toString()}{pool.status} + {!pool.resolved && reputation > 0 && pool.timeRemaining > 0 && ( + <> + + {' '} + + )} + {!pool.resolved && pool.timeRemaining <= 0 && ( + + )} +
+
+
+

Work Contract 1

+
+ {`Price: ${work1Price} ETH`} +
+
+ Stake Availability: {' '} - - - )} -
-
- Availability Stake Count: - {' '} - {availabilityStakes.length} -
-
- - - - - - - - - - - - - - {availabilityStakes.filter((x) => !!x).map((s) => ( - - - - - - - - + + ))} + +
IDWorkerAmountEnd TimeAssignedReclaimedActions
{s.id.toString()}{s.worker.toString()}{s.amount.toString()}{new Date(Number(s.endTime) * 1000).toLocaleString()}{s.assigned.toString()}{s.reclaimed.toString()} - {s.currentUserIsWorker() && ( - - )} - {s.currentUserIsWorker() && s.timeRemaining <= 0 + {!reputation && <>No reputation available to stake} + {reputation > 0 && ( + <> + + {' '} + + + )} + +
+ Availability Stake Count: + {' '} + {availabilityStakes.length} +
+
+ + + + + + + + + + + + + + {availabilityStakes.filter((x) => !!x).map((s) => ( + + + + + + + + - - ))} - -
IDWorkerAmountEnd TimeAssignedReclaimedActions
{s.id.toString()}{s.worker.toString()}{s.amount.toString()}{new Date(Number(s.endTime) * 1000).toLocaleString()}{s.assigned.toString()}{s.reclaimed.toString()} + {s.currentUserIsWorker() && ( + + )} + {s.currentUserIsWorker() && s.timeRemaining <= 0 && !s.assigned && !s.reclaimed && ( <> {' '} @@ -565,58 +591,58 @@ function App() { Reclaim - )} -
-
-
- -
-
- Work Request Count: - {' '} - {workRequests.length} -
-
- - - - - - - - - - - - - - - {workRequests.filter((x) => !!x).map((request) => ( - - - - - - - - - + + ))} + +
IDCustomerFeeStatusStake IDApprovalPool IDActions
{request.id.toString()}{request.customer.toString()} - {request.feeEther} - {' '} - ETH - {request.statusString}{request.stakeIndex.toString()}{request.approval.toString()}{request.poolIndex.toString()} - {availabilityStakes.length > 0 + )} +
+
+
+ +
+
+ Work Request Count: + {' '} + {workRequests.length} +
+
+ + + + + + + + + + + + + + + {workRequests.filter((x) => !!x).map((request) => ( + + + + + + + + + - - ))} - -
IDCustomerFeeStatusStake IDApprovalPool IDActions
{request.id.toString()}{request.customer.toString()} + {request.feeEther} + {' '} + ETH + {request.statusString}{request.stakeIndex.toString()}{request.approval.toString()}{request.poolIndex.toString()} + {availabilityStakes.length > 0 && availabilityStakes[Number(request.stakeIndex)]?.currentUserIsWorker() && Number(request.status) === 0 && ( - )} - {request.currentUserIsCustomer() + )} + {request.currentUserIsCustomer() && Number(request.status) === 1 && ( <> - )} -
-
- + )} +
+
+
+ + + TBD + + + TBD + + )}