Skip to content

Commit

Permalink
fix(Coinify): check for KYC state when rendering component
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed Jun 4, 2018
1 parent aacfcee commit 15b46d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const CoinifyBuy = props => {
</LeftContainer>
<RightContainer>
{
value.kycs.length
value.kycs.length && path(['state'], kyc)
? <KYCNotification kyc={kyc} limits={limits.buy} symbol={symbol} onTrigger={(kyc) => handleKycAction(kyc)} canTrade={canTrade.data} />
: null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ const LimitsNotice = styled.div`
const KYCNotification = (props) => {
const { kyc, onTrigger, symbol, limits, type, canTrade } = props

const state = path(['state'], kyc)
const header = kycHeaderHelper(state)
const body = kycNotificationBodyHelper(state)
const status = path(['state'], kyc)
const header = kycHeaderHelper(status)
const body = kycNotificationBodyHelper(status)

let effBal = limits.effectiveMax / 1e8
let sellMax = Math.min(effBal, limits.max)

return (
<Wrapper>
{
(state === 'pending' || state === 'reviewing') && canTrade
(status === 'pending' || status === 'reviewing') && canTrade
? <LimitsNotice>
<Text size='12px' weight={300}>
{
Expand All @@ -49,16 +49,16 @@ const KYCNotification = (props) => {
}
<ISXContainer>
<Text size='13px' color='brand-primary' weight={400} style={spacing('mb-20')}>
{ state && header.text }
{ path(['text'], header) }
</Text>
<Text size='13px' weight={300} style={spacing('mb-20')}>
{ state && body.text }
{ path(['text'], body) }
</Text>
{
state === 'pending' || state === 'rejected' || state === 'expired'
status === 'pending' || status === 'rejected' || status === 'expired'
? <Button onClick={() => onTrigger(kyc)} nature='empty-secondary'>
<Text size='13px' color='brand-secondary'>
{ state && path(['text'], kycNotificationButtonHelper(state)) }
{ path(['text'], kycNotificationButtonHelper(status)) }
</Text>
</Button>
: null
Expand Down

0 comments on commit 15b46d3

Please sign in to comment.