-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Wallet): add welcome banner (#1337)
- Loading branch information
1 parent
c1e15ac
commit 66db4d1
Showing
12 changed files
with
915 additions
and
13 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
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
104 changes: 104 additions & 0 deletions
104
src/pages/Wallet/WalletOverview/components/WelcomeBanner/WelcomeBanner.styles.tsx
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,104 @@ | ||
import styled from 'styled-components'; | ||
|
||
import { XMark } from '@/assets/icons'; | ||
import { ReactComponent as BTCDefi } from '@/assets/img/btc-defi.svg'; | ||
import { Card, CTA, CTALink, Flex, H2, P, theme } from '@/component-library'; | ||
|
||
const StyledCard = styled(Card)` | ||
position: relative; | ||
overflow: hidden; | ||
z-index: 0; | ||
background-color: #1a0144; | ||
`; | ||
|
||
const StyledImageWrapper = styled(Flex)` | ||
display: none; | ||
flex: 0; | ||
@media ${theme.breakpoints.up('md')} { | ||
display: flex; | ||
margin-right: ${theme.spacing.spacing6}; | ||
} | ||
@media ${theme.breakpoints.up('lg')} { | ||
margin-right: ${theme.spacing.spacing10}; | ||
} | ||
`; | ||
|
||
const StyledSVG = styled(BTCDefi)` | ||
width: 9.875rem; | ||
height: 8.125rem; | ||
@media ${theme.breakpoints.up('md')} { | ||
display: block; | ||
top: ${theme.spacing.spacing8}; | ||
bottom: ${theme.spacing.spacing8}; | ||
right: ${theme.spacing.spacing18}; | ||
} | ||
`; | ||
|
||
const StyledTextWrapper = styled(Flex)` | ||
@media ${theme.breakpoints.up('md')} { | ||
max-width: 70%; | ||
} | ||
`; | ||
|
||
const StyledCloseCTA = styled(CTA)` | ||
position: absolute; | ||
top: ${theme.spacing.spacing3}; | ||
right: ${theme.spacing.spacing3}; | ||
`; | ||
|
||
const StyledXMark = styled(XMark)` | ||
color: var(--colors-neutral-white); | ||
`; | ||
|
||
const StyledP = styled(P)` | ||
color: #ffffffb2; | ||
`; | ||
|
||
const StyledCTALink = styled(CTALink)` | ||
border-radius: ${theme.rounded.lg}; | ||
font-size: ${theme.text.s}; | ||
padding: ${theme.spacing.spacing2} ${theme.spacing.spacing6}; | ||
color: #1a0144; | ||
background-color: var(--colors-neutral-white); | ||
&:hover:not([disabled]) { | ||
background-color: var(--colors-neutral-lighter-grey); | ||
} | ||
`; | ||
|
||
const StyledTitle = styled(H2)` | ||
color: var(--colors-neutral-white); | ||
font-size: ${theme.text.lg}; | ||
`; | ||
|
||
const StyledCTAGroup = styled(Flex)` | ||
flex-wrap: wrap; | ||
@media ${theme.breakpoints.up('sm')} { | ||
flex-wrap: nowrap; | ||
} | ||
@media ${theme.breakpoints.up('lg')} { | ||
max-width: 70%; | ||
} | ||
@media ${theme.breakpoints.up('xl')} { | ||
max-width: 50%; | ||
} | ||
`; | ||
|
||
export { | ||
StyledCard, | ||
StyledCloseCTA, | ||
StyledCTAGroup, | ||
StyledCTALink, | ||
StyledImageWrapper, | ||
StyledP, | ||
StyledSVG, | ||
StyledTextWrapper, | ||
StyledTitle, | ||
StyledXMark | ||
}; |
62 changes: 62 additions & 0 deletions
62
src/pages/Wallet/WalletOverview/components/WelcomeBanner/WelcomeBanner.tsx
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,62 @@ | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { Flex } from '@/component-library'; | ||
import { INTERLAY_WHITEPAPPER } from '@/config/links'; | ||
import { APP_NAME, WRAPPED_TOKEN } from '@/config/relay-chains'; | ||
|
||
import { | ||
StyledCard, | ||
StyledCloseCTA, | ||
StyledCTAGroup, | ||
StyledCTALink, | ||
StyledImageWrapper, | ||
StyledP, | ||
StyledSVG, | ||
StyledTextWrapper, | ||
StyledTitle, | ||
StyledXMark | ||
} from './WelcomeBanner.styles'; | ||
|
||
type WelcomeBannerProps = { | ||
onClose: () => void; | ||
}; | ||
|
||
const WelcomeBanner = ({ onClose }: WelcomeBannerProps): JSX.Element => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<StyledCard direction='row' gap='spacing4' justifyContent='space-between' alignItems='center'> | ||
<StyledTextWrapper direction='column' gap='spacing6'> | ||
<Flex direction='column' gap='spacing4'> | ||
<StyledTitle weight='bold' size='xl2'> | ||
{t('wallet.welcome_to_dapp', { name: APP_NAME })} | ||
</StyledTitle> | ||
<StyledP size='s' color='tertiary'> | ||
{t('wallet.dapp_is_a_one_stop_shop_for_bitcoin_defi', { | ||
name: APP_NAME, | ||
wrappedToken: WRAPPED_TOKEN.ticker | ||
})} | ||
</StyledP> | ||
</Flex> | ||
<StyledCTAGroup gap='spacing4'> | ||
<StyledCTALink fullWidth external icon to={INTERLAY_WHITEPAPPER}> | ||
Whitepaper | ||
</StyledCTALink> | ||
{/* TODO: to be added */} | ||
<StyledCTALink fullWidth external icon to={'#'}> | ||
Fund Wallet Guide | ||
</StyledCTALink> | ||
</StyledCTAGroup> | ||
</StyledTextWrapper> | ||
<StyledImageWrapper> | ||
<StyledSVG aria-label='bitcoin defi' /> | ||
</StyledImageWrapper> | ||
<StyledCloseCTA size='small' variant='text' aria-label='dimiss welcome banner' onPress={onClose}> | ||
<StyledXMark /> | ||
</StyledCloseCTA> | ||
</StyledCard> | ||
); | ||
}; | ||
|
||
export { WelcomeBanner }; | ||
export type { WelcomeBannerProps }; |
2 changes: 2 additions & 0 deletions
2
src/pages/Wallet/WalletOverview/components/WelcomeBanner/index.tsx
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,2 @@ | ||
export type { WelcomeBannerProps } from './WelcomeBanner'; | ||
export { WelcomeBanner } from './WelcomeBanner'; |
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,6 +1,7 @@ | ||
import { AvailableAssetsTable, AvailableAssetsTableProps } from './AvailableAssetsTable'; | ||
import { StakingTable, StakingTableProps } from './StakingTable'; | ||
import { WalletInsights, WalletInsightsProps } from './WalletInsights'; | ||
import { WelcomeBanner, WelcomeBannerProps } from './WelcomeBanner'; | ||
|
||
export { AvailableAssetsTable, StakingTable, WalletInsights }; | ||
export type { AvailableAssetsTableProps, StakingTableProps, WalletInsightsProps }; | ||
export { AvailableAssetsTable, StakingTable, WalletInsights, WelcomeBanner }; | ||
export type { AvailableAssetsTableProps, StakingTableProps, WalletInsightsProps, WelcomeBannerProps }; |
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
66db4d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
interbtc-ui-interlay-testnet – ./
interbtc-ui-interlay-testnet-git-master-interlay.vercel.app
interbtc-ui-interlay-testnet-interlay.vercel.app
testnet.interlay.io
interbtc-ui-interlay-testnet.vercel.app
66db4d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
interbtc-ui-kintsugi-testnet – ./
interbtc-ui-kintsugi-testnet-git-master-interlay.vercel.app
interbtc-ui.vercel.app
interbtc-ui-kintsugi-testnet-interlay.vercel.app
kintnet.interlay.io