Skip to content

Commit

Permalink
feat(Jumio): add profile limit and trade processing time data to jumi…
Browse files Browse the repository at this point in the history
…ostatus
  • Loading branch information
plondon committed Jul 22, 2018
1 parent 193d9d4 commit 7330e22
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ class JumioStatusContainer extends React.PureComponent {

render () {
return this.props.data.cata({
Success: value => <Success value={value} onClick={this.openJumio} />,
Success: value => (
<Success
profile={value.profile}
onClick={this.openJumio}
jumioStatus={value.jumioStatus}
/>
),
Loading: () => <div />,
NotAsked: () => <div />,
Failure: () => <div />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import { path } from 'ramda'
import { lift, path } from 'ramda'
import { selectors } from 'data'

export const getData = state => path(['sfoxSignup', 'jumioStatus'])(state)
export const getData = state => {
const jumioStatusR = path(['sfoxSignup', 'jumioStatus'])(state)
const profileR = selectors.core.data.sfox.getProfile(state)

const transform = (jumioStatus, profile) => {
return {
jumioStatus,
profile
}
}

return lift(transform)(jumioStatusR, profileR)
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,26 @@ const ButtonWrapper = styled.div`
}
`

export const Success = ({ value, onClick }) => {
const { status, completed } = value
export const Success = ({ jumioStatus, profile, onClick }) => {
const { status, completed } = jumioStatus

const profileStatusHelper = () => {
let minutesInADay = 1440
return (
<Text weight={300} size={'14px'}>
<FormattedMessage
id='scenes.buysell.sfoxcheckout.content.jumio.profile'
defaultMessage='Buy Limit: {buyLimit}. Sell Limit: {sellLimit}. Buy trades will take {buyProcessingTime} days to process and sell trades {sellProcessingTime} days.'
values={{
buyLimit: '$' + profile.limits.buy,
sellLimit: '$' + profile.limits.sell,
buyProcessingTime: profile.processingTimes.usd.buy / minutesInADay,
sellProcessingTime: profile.processingTimes.usd.sell / minutesInADay
}}
/>
</Text>
)
}
const statusTitleHelper = () => {
switch (status) {
case 'DONE':
Expand Down Expand Up @@ -123,7 +141,11 @@ export const Success = ({ value, onClick }) => {
return (
<Container>
<Title>{statusTitleHelper()}</Title>
<Body>{statusBodyHelper()}</Body>
<Body>
{statusBodyHelper()}
<br />
{profileStatusHelper()}
</Body>
<ButtonWrapper>{statusButtonHelper()}</ButtonWrapper>
</Container>
)
Expand Down

0 comments on commit 7330e22

Please sign in to comment.