Skip to content

Commit

Permalink
feat(frictions): swap block & info color
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Jan 16, 2024
1 parent 2da02a0 commit fe9a91b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import BigNumber from 'bignumber.js'
import { differenceInMilliseconds } from 'date-fns'
import { call, delay, put, select, take } from 'redux-saga/effects'
import { call as typedCall } from 'typed-redux-saga'

import { Exchange } from '@core'
import { APIType } from '@core/network/api'
Expand Down Expand Up @@ -610,6 +611,16 @@ export default ({ api, coreSagas, networks }: { api: APIType; coreSagas; network
return
}

const steps = yield* typedCall(api.fetchVerificationSteps)
if (steps.items[steps.items.length - 1].status === 'DISABLED') {
yield put(
actions.modals.showModal(ModalName.COMPLETE_USER_PROFILE, { origin: 'BuySellInit' })
)
yield put(actions.modals.closeModal(ModalName.SWAP_MODAL))

return
}

const message =
products.swap.reasonNotEligible.reason !== CustodialSanctionsEnum.EU_5_SANCTION
? products.swap.reasonNotEligible.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,15 @@ const Success = ({
// "style": "EXPANDABLE" | "PLAIN" | "WARNING" | "ERROR" | "NOTICE" | "SUCCESS"
const renderNodeInfo = (node: NodeItem) => {
return (
<InfoWrapper>
<InfoWrapper type={node.style}>
<Text size='14px' weight={600}>
{node.text}
</Text>
<Text size='12px' weight={500} color='grey900'>
{node.description}
</Text>
{node.description && (
<Text size='12px' weight={500} color='grey900'>
<ReactMarkdown>{node.description}</ReactMarkdown>
</Text>
)}
</InfoWrapper>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,13 @@ export const LabelItem = styled.label`
cursor: pointer;
`

export const InfoWrapper = styled.div`
export const InfoWrapper = styled.div<{ type?: string }>`
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 1rem;
border-radius: 0.5rem;
margin-bottom: 0.5rem;
background-color: ${(props) => props.theme.grey000};
border: ${(props) => (props.type === 'WARNING' ? '1px solid #D46A00' : 'none')};
`
1 change: 1 addition & 0 deletions packages/blockchain-wallet-v4/src/network/api/kyc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type NodeItem = {
input?: string
instructions?: string
isDropdown?: boolean
style?: string
text: string
type: string
}
Expand Down

0 comments on commit fe9a91b

Please sign in to comment.