-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-summary (Feature) Token holder account summary
- Loading branch information
Showing
32 changed files
with
575 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
.App { | ||
text-align: center; | ||
.AccountSummaryGridContainer { | ||
margin: 0!important; | ||
position: relative; | ||
width: 100%!important; | ||
z-index: 12; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 40vmin; | ||
.AccountSummaryCard { | ||
align-items: center; | ||
box-sizing: border-box; | ||
justify-content: center; | ||
margin: 0!important; | ||
max-height: 200px; | ||
max-width: 200px!important; | ||
min-height: 200px; | ||
min-width: 200px!important; | ||
padding: 10px; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
.AccountSummaryCard h3 { | ||
font-size: 20px; | ||
line-height: 1.2; | ||
margin: 0 0 15px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/Components/AccountSummary/AccSummarySubscriptionForm/AccountSummarySubscriptionForm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/Components/AccountSummary/AccountSummaryData/AccountSummaryData.css
This file was deleted.
Oops, something went wrong.
153 changes: 112 additions & 41 deletions
153
src/Components/AccountSummary/AccountSummaryData/AccountSummaryData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,117 @@ | ||
import AccountSummaryStyle from '../AccountSummaryHome/AccountSummaryStyle' | ||
import React from 'react' | ||
import './AccountSummaryData.css' | ||
import Table from '@material-ui/core/Table' | ||
import TableBody from '@material-ui/core/TableBody' | ||
import TableCell from '@material-ui/core/TableCell' | ||
import TableHead from '@material-ui/core/TableHead' | ||
import TableRow from '@material-ui/core/TableRow' | ||
import tableStyle from '../../../assets/jss/dashboard/components/tableStyle' | ||
import { withStyles } from '@material-ui/core/styles' | ||
|
||
const AccountSummaryData = props => { | ||
let statusMsg = getStatusMsg(props) | ||
const tableData = [ | ||
{ title: 'BondedAmount', data: props.summary.bondedAmount }, | ||
{ | ||
title: 'Earned from delegate fees', | ||
data: props.summary.fees | ||
}, | ||
{ | ||
title: 'Status', | ||
data: props.summary.status + ', ' + statusMsg | ||
}, | ||
{ | ||
title: 'Stake', | ||
data: props.summary.stake + ' LPT' | ||
} | ||
] | ||
const { classes } = props | ||
|
||
return ( | ||
<> | ||
<table className="accountSummaryDataTable"> | ||
<thead> | ||
<tr> | ||
<th colSpan="2">Summary Information</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>BondedAmount</td> | ||
<td>{props.summary.bondedAmount} </td> | ||
</tr> | ||
<tr> | ||
<td>Fees</td> | ||
<td>{props.summary.fees}</td> | ||
</tr> | ||
<tr> | ||
<td>Status</td> | ||
<td>{props.summary.status}</td> | ||
</tr> | ||
<tr> | ||
<td>LastClaimRound</td> | ||
<td>{props.summary.lastClaimRound}</td> | ||
</tr> | ||
<tr> | ||
<td>StartRound</td> | ||
<td>{props.summary.startRound}</td> | ||
</tr> | ||
<tr> | ||
<td>WithdrawRound</td> | ||
<td>{props.summary.withdrawRound}</td> | ||
</tr> | ||
<tr> | ||
<td>Stake</td> | ||
<td>{props.summary.totalStake}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</> | ||
<Table className={classes.table}> | ||
<TableHead> | ||
<TableRow> | ||
<TableCell | ||
colSpan="2" | ||
className={`${classes.tableHeadCel} ${classes.noWrap} ${classes.pL0} ${classes.pR0} ${ | ||
classes.tableTitle | ||
}`} | ||
> | ||
Summary Information | ||
</TableCell> | ||
</TableRow> | ||
</TableHead> | ||
<TableBody> | ||
{tableData.map((item, index) => { | ||
return ( | ||
<TableRow key={index}> | ||
<TableCell className={`${classes.tableCell} ${classes.noWrap}`}> | ||
{item.title} | ||
</TableCell> | ||
<TableCell | ||
className={`${classes.tableCell} ${classes.textRight} ${classes.wordBreak}`} | ||
> | ||
{item.data} | ||
</TableCell> | ||
</TableRow> | ||
) | ||
})} | ||
</TableBody> | ||
</Table> | ||
) | ||
} | ||
export default AccountSummaryData | ||
|
||
const getStatusMsg = props => { | ||
let msg | ||
switch (props.summary && props.summary.status) { | ||
case 'Pending': { | ||
msg = ( | ||
<td> | ||
your LPT is getting deluded by the protocol's token inflation. Add value to the network, | ||
bond to a transcoder here. | ||
</td> | ||
) | ||
msg = | ||
" your LPT is getting deluded by the protocol's token inflation. Add value to the network,\n" + | ||
' bond to a transcoder here.' | ||
break | ||
} | ||
case 'Bonded': { | ||
msg = ( | ||
<td> | ||
bonded to transcoder {props.summary.delegateAddress} at round {props.summary.startRound} | ||
</td> | ||
) | ||
msg = | ||
'bonded to transcoder ' + | ||
props.summary.delegateAddress + | ||
'at round {props.summary.startRound}' | ||
break | ||
} | ||
case 'Unbonding': { | ||
msg = <td>your still have to wait a few moments to get finally unbonded.</td> | ||
msg = 'your still have to wait a few moments to get finally unbonded.' | ||
break | ||
} | ||
case 'Unbonded': { | ||
msg = ( | ||
<td> | ||
your LPT is getting deluded by the protocol's token inflation. Add value to the network, | ||
bond to a transcoder here. | ||
</td> | ||
) | ||
msg = | ||
"your LPT is getting deluded by the protocol's token inflation. Add value to the network,\n" + | ||
' bond to a transcoder here.' | ||
break | ||
} | ||
default: | ||
msg = null | ||
} | ||
return msg | ||
} | ||
|
||
export default withStyles(theme => ({ | ||
...AccountSummaryStyle, | ||
...tableStyle(theme) | ||
}))(AccountSummaryData) |
Oops, something went wrong.