forked from nervosnetwork/ckb-explorer-frontend
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
9 changed files
with
338 additions
and
121 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
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 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,109 @@ | ||
@import '../../styles/variables.module'; | ||
|
||
.holderAllocationContainer { | ||
background-color: #fff; | ||
margin: 15% auto; | ||
padding: 20px 24px 20px 40px; | ||
width: 497px; | ||
border-radius: 4px; | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
@media (max-width: $mobileBreakPoint) { | ||
width: 90%; | ||
margin-top: 20vh; | ||
padding: 24px 16px; | ||
} | ||
|
||
.closeIcon { | ||
img { | ||
width: 16px; | ||
height: 16px; | ||
} | ||
} | ||
|
||
.holderAllocationContent { | ||
background-color: #fff; | ||
border-radius: 4px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 24px; | ||
|
||
@media (max-width: $mobileBreakPoint) { | ||
align-items: flex-start; | ||
|
||
p { | ||
line-height: 24px; | ||
} | ||
} | ||
|
||
h2 { | ||
color: #333; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 700; | ||
margin: 0; | ||
} | ||
|
||
p { | ||
margin: 0; | ||
color: #333; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
width: 100%; | ||
word-wrap: break-word; | ||
} | ||
|
||
.table { | ||
border-radius: 4px; | ||
border: 1px solid #e5e5e5; | ||
padding: 1px; | ||
|
||
table { | ||
thead { | ||
background: #fafafa; | ||
|
||
tr { | ||
div { | ||
color: #666; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
text-transform: capitalize; | ||
} | ||
} | ||
} | ||
|
||
tbody { | ||
tr { | ||
div { | ||
color: #333; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
} | ||
} | ||
} | ||
|
||
thead, | ||
tbody { | ||
tr { | ||
border-radius: 4px; | ||
|
||
div { | ||
font-size: 14px; | ||
padding: 12px 16px; | ||
} | ||
} | ||
} | ||
|
||
width: 312px; | ||
background: #fff; | ||
} | ||
} | ||
} | ||
} |
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,69 @@ | ||
import { useTranslation } from 'react-i18next' | ||
import { MouseEventHandler } from 'react' | ||
import styles from './HolderAllocation.module.scss' | ||
import { localeNumberString } from '../../utils/number' | ||
import CloseIcon from '../../assets/modal_close.png' | ||
import SimpleButton from '../../components/SimpleButton' | ||
|
||
const HolderAllocation = ({ | ||
ckbHolderAmount, | ||
btcHolderAmount, | ||
lockHoderAmount, | ||
onClose, | ||
}: { | ||
ckbHolderAmount: string | ||
btcHolderAmount: string | ||
lockHoderAmount?: { | ||
lock: string | ||
holderAmount: string | ||
}[] | ||
onClose: MouseEventHandler<HTMLDivElement> | ||
}) => { | ||
const [t] = useTranslation() | ||
return ( | ||
<div className={styles.holderAllocationContainer}> | ||
<div className={styles.holderAllocationContent}> | ||
<h2>{t('xudt.holder_allocation')}</h2> | ||
<p> | ||
{t('xudt.holder_allocation_description', { | ||
ckb: localeNumberString(ckbHolderAmount), | ||
btc: localeNumberString(btcHolderAmount), | ||
})} | ||
</p> | ||
{lockHoderAmount && ( | ||
<div className={styles.table}> | ||
<table> | ||
<thead> | ||
<tr> | ||
<td> | ||
<div>{t('xudt.lock_hash')}</div> | ||
</td> | ||
<td> | ||
<div>{t('xudt.count')}</div> | ||
</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{lockHoderAmount.map(amount => ( | ||
<tr> | ||
<td> | ||
<div>{amount.lock}</div> | ||
</td> | ||
<td> | ||
<div>{amount.holderAmount}</div> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
)} | ||
</div> | ||
<SimpleButton onClick={onClose} className={styles.closeIcon}> | ||
<img src={CloseIcon} alt="close icon" /> | ||
</SimpleButton> | ||
</div> | ||
) | ||
} | ||
|
||
export default HolderAllocation |
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
Oops, something went wrong.