Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(prove): added bcpay prove dedicated link #6355

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ export const LINK_BACK_TO_APP =

export const VFP_STORE_URL = '/nabu-gateway/onboarding/prove/possession/instant-link/vfp-store'

export const TEXT_ELEMENTS = {
export const TEXT_ELEMENTS = (isBcPay: boolean) => ({
error: {
description:
'Return to the Blockchain.com App to get a new one and continue with the verification process.',
description: isBcPay
? 'Return to the Blockchain.com Pay to get a new one and continue with the verification process by closing this tab.'
milan-bc marked this conversation as resolved.
Show resolved Hide resolved
: 'Return to the Blockchain.com App to get a new one and continue with the verification process.',
iconProps: {
color: 'error',
name: 'close-circle'
},
title: 'Your link has expired'
},
verified: {
description: 'Return to the Blockchain.com App to continue with the verification process.',
description: isBcPay
? 'Return to the Blockchain.com Pay by closing this tab.'
milan-bc marked this conversation as resolved.
Show resolved Hide resolved
: 'Return to the Blockchain.com App to continue with the verification process.',
iconProps: {
color: 'success',
name: 'checkmark-circle-filled'
},
title: 'Your device is verified!'
}
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const ContentWrapper = styled.div`

const Prove: React.FC<ProveProps> = ({ location: { pathname, search } }) => {
const isExpired = pathname.includes('/expired')
const isBCPay = pathname.includes('/bcpay')

const [proveStatus, setProveStatus] = useState<ProveStates>(isExpired ? 'error' : 'loading')

Expand All @@ -47,7 +48,7 @@ const Prove: React.FC<ProveProps> = ({ location: { pathname, search } }) => {

if (proveStatus === 'loading') return <SpinningLoader />

const { description, iconProps, title } = TEXT_ELEMENTS[proveStatus]
const { description, iconProps, title } = TEXT_ELEMENTS(isBCPay)[proveStatus]

return (
<Wrapper>
Expand All @@ -69,14 +70,16 @@ const Prove: React.FC<ProveProps> = ({ location: { pathname, search } }) => {
/>
</Text>
</ContentWrapper>
<Link href={LINK_BACK_TO_APP}>
<Button data-e2e='back-to-app' fullwidth style={{ marginTop: '1rem' }}>
<FormattedMessage
id='scenes.prove.back'
defaultMessage='Go back to the Blockchain.com App'
/>
</Button>
</Link>
{!isBCPay && (
<Link href={LINK_BACK_TO_APP}>
<Button data-e2e='back-to-app' fullwidth style={{ marginTop: '1rem' }}>
<FormattedMessage
id='scenes.prove.back'
defaultMessage='Go back to the Blockchain.com App'
/>
</Button>
</Link>
)}
</Wrapper>
)
}
Expand Down
7 changes: 7 additions & 0 deletions packages/blockchain-wallet-v4-frontend/src/scenes/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ const App = ({
pageTitle={`${BLOCKCHAIN_TITLE} | Verify Device`}
/>
)}
{isProveEnabled && (
<AuthLayout
path='/prove/bcpay/instant-link/callback'
component={Prove}
pageTitle={`${BLOCKCHAIN_TITLE} | Verify Device`}
/>
)}
{/* DEX routes */}
{isDexEnabled && (
<DexLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const getImportedAddressSweep = (state: RootState) =>
// prove
export const getProveEnabled = (state: RootState) =>
getWebOptions(state).map(path(['featureFlags', 'proveEnabled']))

export const getFiatEntityRemediationAlert = (state: RootState) =>
getWebOptions(state).map(path(['featureFlags', 'showFiatEntityRemediationAlert']))
// sofi
Expand Down
Loading