-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b626581
commit 31596bd
Showing
8 changed files
with
249 additions
and
17 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
25 changes: 13 additions & 12 deletions
25
packages/frontend/src/components/transfers/TransfersList.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import WithdrawalsList from './withdrawals/WithdrawalsList' | ||
import TransfersList from './TransfersList' | ||
|
||
export { | ||
TransfersList, | ||
WithdrawalsList | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/frontend/src/components/transfers/withdrawals/WithdrawalsList.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import WithdrawalsListItem from './WithdrawalsListItem' | ||
import { EmptyListMessage } from '../../ui/lists' | ||
import { Grid, GridItem } from '@chakra-ui/react' | ||
import './WithdrawalsList.scss' | ||
|
||
function WithdrawalsList ({ withdrawals = [], headerStyles = 'default' }) { | ||
const headerExtraClass = { | ||
default: '', | ||
light: 'BlocksList__ColumnTitles--Light' | ||
} | ||
|
||
return ( | ||
<div className={'WithdrawalsList'}> | ||
<Grid className={`WithdrawalsList__ColumnTitles ${headerExtraClass[headerStyles] || ''}`}> | ||
<GridItem className={'WithdrawalsList__ColumnTitle'}> | ||
Timestamp | ||
</GridItem> | ||
<GridItem className={'WithdrawalsList__ColumnTitle WithdrawalsList__ColumnTitle--Hash'}> | ||
Tx hash | ||
</GridItem> | ||
<GridItem className={'WithdrawalsList__ColumnTitle'}> | ||
Address | ||
</GridItem> | ||
<GridItem className={'WithdrawalsList__ColumnTitle'}> | ||
Document | ||
</GridItem> | ||
<GridItem className={'WithdrawalsList__ColumnTitle'}> | ||
Amount | ||
</GridItem> | ||
<GridItem className={'WithdrawalsList__ColumnTitle'}> | ||
Status | ||
</GridItem> | ||
</Grid> | ||
|
||
{withdrawals.map((withdrawal, key) => | ||
<WithdrawalsListItem | ||
key={key} | ||
withdrawal={withdrawal} | ||
/> | ||
)} | ||
|
||
{withdrawals.length === 0 && | ||
<EmptyListMessage>There are no transfers yet.</EmptyListMessage> | ||
} | ||
</div> | ||
) | ||
} | ||
|
||
export default WithdrawalsList |
26 changes: 26 additions & 0 deletions
26
packages/frontend/src/components/transfers/withdrawals/WithdrawalsList.scss
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@use '../../../styles/mixins.scss'; | ||
@use './variables' as withdrawals; | ||
@import '../../../styles/variables.scss'; | ||
|
||
.WithdrawalsList { | ||
container-type: inline-size; | ||
|
||
&__ColumnTitles { | ||
@include mixins.defListTitles; | ||
@include withdrawals.Columns(); | ||
} | ||
|
||
&__ColumnTitle { | ||
@include withdrawals.Column(); | ||
|
||
&:last-child { | ||
text-align: right; | ||
} | ||
} | ||
|
||
&__Column { | ||
&--Address { | ||
|
||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/frontend/src/components/transfers/withdrawals/WithdrawalsListItem.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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Grid, GridItem } from '@chakra-ui/react' | ||
import { ArrowCornerIcon } from '../../ui/icons' | ||
import { Identifier, Credits } from '../../data' | ||
import './WithdrawalsListItem.scss' | ||
|
||
function WithdrawalsListItem ({ withdrawal }) { | ||
// temp | ||
if (!withdrawal?.recipient) withdrawal.recipient = '376neLp6VAHDRvEFUG5ZR1tuevHynCGB3Scjaa8BodG7' | ||
|
||
return ( | ||
<div className={'WithdrawalsListItem'}> | ||
<Grid className={'WithdrawalsListItem__Content'}> | ||
<GridItem className={'WithdrawalsListItem__Column WithdrawalsListItem__Column--Timestamp'}> | ||
{new Date(withdrawal.timestamp).toLocaleString()} | ||
</GridItem> | ||
|
||
<GridItem className={'WithdrawalsListItem__Column WithdrawalsListItem__Column--TxHash'}> | ||
<Identifier styles={['highlight-both']}>{withdrawal.txHash}</Identifier> | ||
</GridItem> | ||
|
||
<GridItem className={'WithdrawalsListItem__Column WithdrawalsListItem__Column--Address'}> | ||
{withdrawal?.recipient && | ||
<a href={withdrawal.recipient}> | ||
<ArrowCornerIcon color={'brand.normal'} w={'10px'} h={'10px'} mr={'10px'}/> | ||
<Identifier styles={['highlight-both']}>{withdrawal.recipient}</Identifier> | ||
</a> | ||
} | ||
</GridItem> | ||
|
||
<GridItem className={'WithdrawalsListItem__Column WithdrawalsListItem__Column--Document'}> | ||
- | ||
</GridItem> | ||
|
||
<GridItem className={'WithdrawalsListItem__Column WithdrawalsListItem__Column--Amount'}> | ||
<Credits>{withdrawal.amount}</Credits> | ||
</GridItem> | ||
|
||
<GridItem className={'WithdrawalsListItem__Column WithdrawalsListItem__Column--Status'}> | ||
|
||
</GridItem> | ||
</Grid> | ||
</div> | ||
) | ||
} | ||
|
||
export default WithdrawalsListItem |
43 changes: 43 additions & 0 deletions
43
packages/frontend/src/components/transfers/withdrawals/WithdrawalsListItem.scss
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@use '../../../styles/mixins.scss'; | ||
@use './variables' as withdrawals; | ||
@import '../../../styles/variables.scss'; | ||
|
||
.WithdrawalsListItem { | ||
@include mixins.DefListItem; | ||
flex-wrap: wrap; | ||
|
||
&:hover { | ||
cursor: default; | ||
} | ||
|
||
&__Content { | ||
@include withdrawals.Columns(); | ||
} | ||
|
||
&__Column { | ||
@include withdrawals.Column(); | ||
font-size: 0.688rem; | ||
|
||
&--Timestamp { | ||
font-size: 0.688rem; | ||
} | ||
|
||
&--TxHash { | ||
.Identifier { | ||
font-size: 0.688rem; | ||
} | ||
} | ||
|
||
&--Address { | ||
.Identifier { | ||
font-size: 0.688rem; | ||
} | ||
|
||
a { | ||
display: flex; | ||
align-items: center; | ||
overflow: hidden; | ||
} | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
packages/frontend/src/components/transfers/withdrawals/_variables.scss
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@mixin Columns () { | ||
display: grid; | ||
gap: 16px; | ||
grid-template-columns: 133px 70px 78px 78px 118px 18px; | ||
|
||
@container (max-width: 810px) { | ||
grid-template-columns: 133px 70px 78px 78px 118px 18px; | ||
} | ||
} | ||
|
||
@mixin Column () { | ||
display: flex; | ||
align-items: center; | ||
|
||
&--Hash { | ||
max-width: 600px; | ||
} | ||
|
||
&--Sender { | ||
max-width: 400px; | ||
width: 100%; | ||
} | ||
|
||
&--Type { | ||
justify-content: flex-end; | ||
white-space: nowrap; | ||
} | ||
|
||
&--GasUsed { | ||
width: 150px; | ||
} | ||
|
||
@container (max-width: 810px) { | ||
&--GasUsed { | ||
display: none; | ||
} | ||
} | ||
|
||
@container (max-width: 430px) { | ||
&--Sender { | ||
display: none; | ||
} | ||
} | ||
} |