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.
feat: Add calculator for DAO rewards (#275)
Co-authored-by: Chen Yu <[email protected]>
- Loading branch information
1 parent
672050a
commit 9d0e75b
Showing
13 changed files
with
728 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,97 @@ | ||
@import '../../../styles/variables.module'; | ||
|
||
.bannerContainer { | ||
height: 280px; | ||
width: 100%; | ||
border-radius: 4px; | ||
background: #000; | ||
color: #fff; | ||
background-image: url('./banner_bg.svg'); | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
background-size: cover; | ||
|
||
.content { | ||
margin-top: 64px; | ||
margin-left: calc((100% - 570px) / 4); | ||
max-width: 570px; | ||
|
||
p { | ||
margin: 0; | ||
} | ||
|
||
.title { | ||
font-size: 24px; | ||
font-weight: 500; | ||
} | ||
|
||
.description { | ||
font-size: 14px; | ||
margin-top: 16px; | ||
} | ||
|
||
.actions { | ||
display: flex; | ||
gap: 16px; | ||
margin-top: 24px; | ||
} | ||
} | ||
|
||
.btn { | ||
background: transparent; | ||
color: #fff; | ||
border: 1px solid #fff; | ||
display: flex; | ||
gap: 4px; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: 4px; | ||
padding: 8px 12px; | ||
cursor: pointer; | ||
font-size: 14px; | ||
line-height: 14px; | ||
transition: none; | ||
|
||
.icon { | ||
path { | ||
fill: #fff; | ||
} | ||
} | ||
|
||
&:hover { | ||
color: var(--primary-color); | ||
border: 1px solid var(--primary-color); | ||
|
||
.icon { | ||
path { | ||
fill: var(--primary-color); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media (width <= $mobileBreakPoint) { | ||
.bannerContainer { | ||
height: auto; | ||
background-image: url('./banner_bg_mobile.svg'); | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
background-size: cover; | ||
|
||
.content { | ||
margin-top: 32px; | ||
margin-bottom: 27px; | ||
max-width: 100%; | ||
margin-left: 16px; | ||
|
||
.actions { | ||
flex-direction: column; | ||
|
||
.btn { | ||
width: 160px; | ||
} | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
import { useState } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { ReactComponent as GoIcon } from '../../../assets/go.svg' | ||
import RewardCalcutorModal from '../RewardCalcutorModal' | ||
import { NERVOS_DAO_RFC_URL } from '../../../constants/common' | ||
import styles from './DaoBanner.module.scss' | ||
|
||
const DaoBanner = ({ estimatedApc }: { estimatedApc: string }) => { | ||
const [showRewardCalcutorModal, setShowRewardCalcutorModal] = useState(false) | ||
const { t } = useTranslation() | ||
|
||
return ( | ||
<div className={styles.bannerContainer}> | ||
<div className={styles.content}> | ||
<p className={styles.title}>{t('nervos_dao.deposit_to_dao')}</p> | ||
<p className={styles.description}>{t('nervos_dao.deposit_to_dao_description')}</p> | ||
<div className={styles.actions}> | ||
<button type="button" className={styles.btn} onClick={() => setShowRewardCalcutorModal(true)}> | ||
{t('nervos_dao.reward_calculator')} | ||
</button> | ||
<a className={styles.btn} href={NERVOS_DAO_RFC_URL} target="_blank" rel="noopener noreferrer"> | ||
{t('nervos_dao.nervos_dao_rfc')} | ||
<GoIcon className={styles.icon} /> | ||
</a> | ||
<a | ||
className={styles.btn} | ||
href="https://www.nervos.org/knowledge-base/nervosdao_withdrawal_process_explained" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{t('nervos_dao.learn_more')} | ||
<GoIcon className={styles.icon} /> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
{showRewardCalcutorModal ? ( | ||
<RewardCalcutorModal estimatedApc={estimatedApc} onClose={() => setShowRewardCalcutorModal(false)} /> | ||
) : null} | ||
</div> | ||
) | ||
} | ||
|
||
export default DaoBanner |
Oops, something went wrong.