-
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.
fix(Tiers): Fix settings/profile, pull email/mobile from wallet payload
- Loading branch information
plondon
committed
Dec 13, 2018
1 parent
550a0d2
commit 59e967c
Showing
7 changed files
with
98 additions
and
17 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
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
57 changes: 55 additions & 2 deletions
57
packages/blockchain-wallet-v4-frontend/src/scenes/Settings/Profile/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 |
---|---|---|
@@ -1,3 +1,56 @@ | ||
import { Profile } from 'scenes/ExchangeProfile' | ||
import React from 'react' | ||
import { connect } from 'react-redux' | ||
import styled from 'styled-components' | ||
|
||
export default Profile | ||
import { actions } from 'data' | ||
import { getData } from './selectors' | ||
|
||
import IdentityVerification from './IdentityVerification' | ||
import DataError from 'components/DataError' | ||
|
||
import { BlockchainLoader } from 'blockchain-info-components' | ||
|
||
const Wrapper = styled.section` | ||
width: 100%; | ||
` | ||
const LoadingWrapper = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
` | ||
const Container = styled.div` | ||
padding: 30px; | ||
width: 100%; | ||
box-sizing: border-box; | ||
` | ||
|
||
const Loading = () => ( | ||
<LoadingWrapper> | ||
<BlockchainLoader /> | ||
</LoadingWrapper> | ||
) | ||
|
||
export const Profile = ({ data, fetchUser }) => | ||
data.cata({ | ||
Success: () => ( | ||
<Wrapper> | ||
<Container> | ||
<IdentityVerification /> | ||
</Container> | ||
</Wrapper> | ||
), | ||
NotAsked: () => <Loading />, | ||
Loading: () => <Loading />, | ||
Failure: () => <DataError onClick={fetchUser} /> | ||
}) | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
fetchUser: () => dispatch(actions.modules.profile.fetchUser()) | ||
}) | ||
|
||
export default connect( | ||
getData, | ||
mapDispatchToProps | ||
)(Profile) |
11 changes: 11 additions & 0 deletions
11
packages/blockchain-wallet-v4-frontend/src/scenes/Settings/Profile/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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { lift } from 'ramda' | ||
|
||
import { selectors } from 'data' | ||
|
||
export const getData = state => { | ||
const transform = (userData, userTiers) => ({ userData, userTiers }) | ||
const userDataR = selectors.modules.profile.getUserData(state) | ||
const userTiersR = selectors.modules.profile.getTiers(state) | ||
const data = lift(transform)(userDataR, userTiersR) | ||
return { data } | ||
} |