-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Swap): get started screen directs to /swap/profile
- Loading branch information
1 parent
4e213e2
commit edd98a2
Showing
5 changed files
with
44 additions
and
41 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
29 changes: 11 additions & 18 deletions
29
...kchain-wallet-v4-frontend/src/scenes/Exchange/GetStarted/StatusBar/Statuses/GetStarted.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 |
---|---|---|
@@ -1,30 +1,23 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import { connect } from 'react-redux' | ||
import { LinkContainer } from 'react-router-bootstrap' | ||
import { FormattedMessage } from 'react-intl' | ||
|
||
import { actions } from 'data' | ||
import { Button } from 'blockchain-info-components' | ||
|
||
const ActionButton = styled(Button).attrs({ nature: 'primary' })` | ||
font-weight: 500; | ||
` | ||
|
||
export const GetStarted = ({ verifyIdentity }) => ( | ||
<ActionButton onClick={verifyIdentity}> | ||
<FormattedMessage | ||
id='scenes.exchange.getstarted.status.getstarted.button' | ||
defaultMessage='Get Started' | ||
/> | ||
</ActionButton> | ||
export const GetStarted = () => ( | ||
<LinkContainer to='/swap/profile'> | ||
<ActionButton> | ||
<FormattedMessage | ||
id='scenes.exchange.getstarted.status.getstarted.button' | ||
defaultMessage='Get Started' | ||
/> | ||
</ActionButton> | ||
</LinkContainer> | ||
) | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
verifyIdentity: () => | ||
dispatch(actions.components.identityVerification.verifyIdentity()) | ||
}) | ||
|
||
export default connect( | ||
undefined, | ||
mapDispatchToProps | ||
)(GetStarted) | ||
export default GetStarted |
22 changes: 15 additions & 7 deletions
22
...d/src/scenes/Exchange/GetStarted/StatusBar/Statuses/__snapshots__/GetStarted.spec.js.snap
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,11 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`GetStarted renders correctly 1`] = ` | ||
<GetStarted__ActionButton> | ||
<FormattedMessage | ||
defaultMessage="Get Started" | ||
id="scenes.exchange.getstarted.status.getstarted.button" | ||
values={Object {}} | ||
/> | ||
</GetStarted__ActionButton> | ||
<LinkContainer | ||
activeClassName="active" | ||
exact={false} | ||
replace={false} | ||
strict={false} | ||
to="/swap/profile" | ||
> | ||
<GetStarted__ActionButton> | ||
<FormattedMessage | ||
defaultMessage="Get Started" | ||
id="scenes.exchange.getstarted.status.getstarted.button" | ||
values={Object {}} | ||
/> | ||
</GetStarted__ActionButton> | ||
</LinkContainer> | ||
`; |
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
14 changes: 8 additions & 6 deletions
14
packages/blockchain-wallet-v4-frontend/src/scenes/Exchange/selectors.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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { equals } from 'ramda' | ||
import { complement, equals, path } from 'ramda' | ||
|
||
import { selectors } from 'data' | ||
import { KYC_STATES } from 'data/modules/profile/model' | ||
import { model, selectors } from 'data' | ||
|
||
const { TIERS_STATES } = model.profile | ||
|
||
export const getData = state => ({ | ||
hasEmail: selectors.core.settings | ||
.getEmail(state) | ||
.map(Boolean) | ||
.getOrElse(false), | ||
verified: selectors.modules.profile | ||
.getUserKYCState(state) | ||
.map(equals(KYC_STATES.VERIFIED)) | ||
userCreated: selectors.modules.profile | ||
.getTiers(state) | ||
.map(path([0, 'state'])) | ||
.map(complement(equals(TIERS_STATES.NONE))) | ||
}) |