-
Notifications
You must be signed in to change notification settings - Fork 504
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
Philip London
committed
Nov 22, 2019
1 parent
c2a2e61
commit 5c30f9e
Showing
7 changed files
with
190 additions
and
8 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
95 changes: 95 additions & 0 deletions
95
packages/blockchain-wallet-v4-frontend/src/scenes/Airdrops/StxAirdrop/index.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,95 @@ | ||
import { Box } from '../AirdropInfo' | ||
import { FormattedHTMLMessage, FormattedMessage } from 'react-intl' | ||
import { Icon, Link, Text } from 'blockchain-info-components' | ||
import { StxStatus } from './model' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const Header = styled.div` | ||
display: flex; | ||
align-items: center; | ||
` | ||
const StatusContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
margin-top: 26px; | ||
min-height: 50px; | ||
> div { | ||
width: 50%; | ||
} | ||
` | ||
const Date = styled.div` | ||
height: 100%; | ||
padding-left: 20px; | ||
border-left: 1px solid ${props => props.theme['grey000']}; | ||
` | ||
|
||
const StxAirdrop = props => { | ||
return ( | ||
<Box> | ||
<Header> | ||
<Icon name='stx' color='stx' size='32px' /> | ||
<Text | ||
size='20px' | ||
color='grey800' | ||
weight={600} | ||
style={{ marginLeft: '16px' }} | ||
> | ||
<FormattedMessage | ||
id='scenes.airdrops.blockstack' | ||
defaultMessage='Blockstack' | ||
/> | ||
</Text> | ||
</Header> | ||
<Text | ||
size='12px' | ||
color='grey600' | ||
weight={500} | ||
style={{ marginTop: '16px' }} | ||
> | ||
<FormattedHTMLMessage | ||
id='scenes.airdrop.stx.stxinfo' | ||
defaultMessage='Own your digital identity and data. With hundreds of decentralized apps in the Blockstack ecosystem.' | ||
/>{' '} | ||
<Link | ||
href='https://blockstack.org/try-blockstack' | ||
target='_blank' | ||
rel='noopener noreferrer' | ||
size='12px' | ||
> | ||
<FormattedHTMLMessage | ||
id='scenes.airdrop.stx.learnmore' | ||
defaultMessage='Learn more' | ||
/> | ||
</Link> | ||
</Text> | ||
<StatusContainer> | ||
<div> | ||
<StxStatus {...props} /> | ||
</div> | ||
<Date> | ||
<Text size='16px' color='grey800' weight={500}> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.feb' | ||
defaultMessage='Feb. 2020' | ||
/> | ||
</Text> | ||
<Text size='12px' color='grey600' weight={500}> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.date' | ||
defaultMessage='Airdrop Date' | ||
/> | ||
</Text> | ||
</Date> | ||
</StatusContainer> | ||
<Text size='11px' color='grey600' style={{ marginTop: '12px' }}> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.regulatory' | ||
defaultMessage="*For regulatory reasons, USA, Canada and Japan nationals can't participate in the airdrop." | ||
/> | ||
</Text> | ||
</Box> | ||
) | ||
} | ||
|
||
export default StxAirdrop |
75 changes: 75 additions & 0 deletions
75
packages/blockchain-wallet-v4-frontend/src/scenes/Airdrops/StxAirdrop/model.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,75 @@ | ||
import { | ||
CustomCartridge, | ||
ErrorCartridge, | ||
GreyCartridge, | ||
SuccessCartridge | ||
} from '../AirdropInfo/model' | ||
import { FormattedMessage } from 'react-intl' | ||
import { model } from 'data' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
const { KYC_STATES } = model.profile | ||
|
||
const BlueCartridge = styled(CustomCartridge)` | ||
cursor: pointer; | ||
background-color: ${props => props.theme['blue600']}; | ||
` | ||
|
||
export const StxStatus = ({ tags, kycState, identityVerificationActions }) => { | ||
switch (kycState) { | ||
case KYC_STATES.REJECTED: | ||
case KYC_STATES.EXPIRED: | ||
return ( | ||
<ErrorCartridge> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.ineligible' | ||
defaultMessage='Ineligible' | ||
/> | ||
</ErrorCartridge> | ||
) | ||
case KYC_STATES.PENDING: | ||
case KYC_STATES.UNDER_REVIEW: | ||
return ( | ||
<GreyCartridge> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.pending' | ||
defaultMessage='Enrollment Pending' | ||
/> | ||
</GreyCartridge> | ||
) | ||
case KYC_STATES.VERIFIED: | ||
return tags['BLOCKSTACK'] ? ( | ||
<SuccessCartridge> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.enrolled' | ||
defaultMessage='Enrolled' | ||
/> | ||
</SuccessCartridge> | ||
) : ( | ||
<BlueCartridge | ||
onClick={() => | ||
identityVerificationActions.claimCampaignClicked('BLOCKSTACK') | ||
} | ||
> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.enroll' | ||
defaultMessage='Enroll' | ||
/> | ||
</BlueCartridge> | ||
) | ||
case KYC_STATES.NONE: | ||
return ( | ||
<BlueCartridge | ||
onClick={() => identityVerificationActions.verifyIdentity(2)} | ||
> | ||
<FormattedMessage | ||
id='scenes.airdrop.stx.upgrade' | ||
defaultMessage='Upgrade' | ||
/> | ||
</BlueCartridge> | ||
) | ||
default: | ||
return null | ||
} | ||
} |
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