Skip to content

Commit

Permalink
KYC screen is broken if there is a referral code
Browse files Browse the repository at this point in the history
  • Loading branch information
leonthuongto committed Jan 16, 2025
1 parent f21c813 commit 4f015c0
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/pages/KYC/IndividualKycFormV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export const FormContainer = styled(FormWrapper)`
const HeaderContainer = styled.div`
display: flex;
justify-content: space-between;
@media (max-width: ${MEDIA_WIDTHS.upToMedium}px) {
flex-direction: column;
}
`

const Title = styled(TYPE.title4)`
Expand All @@ -66,6 +70,11 @@ const ReferralCode = styled.span`
font-weight: 600;
align-self: center;
color: #b8b8cc;
@media (max-width: ${MEDIA_WIDTHS.upToMedium}px) {
align-self: flex-start;
margin-left: 0;
}
`

const ReferralCodeText = styled.span`
Expand Down Expand Up @@ -161,7 +170,7 @@ export default function IndividualKycFormV2() {
}

useEffect(() => {
console.log("APP URL", window.location.href)
console.log('APP URL', window.location.href)
const code = query.get('referralCode')
const storedReferralCode = localStorage.getItem('referralCode')
if (code) {
Expand Down Expand Up @@ -298,27 +307,27 @@ export default function IndividualKycFormV2() {

if (selectedCheckbox === SecondaryContactTypeV2.PROOF_OF_ADDRESS) {
try {
const {status} = await secondaryContact();
const { status } = await secondaryContact()

if (status !== 200) {
setLoading(false)
return;
return
}
} catch (error) {
setLoading(false)
return;
return
}
}

try {
const {data, status} = await verifyIdentity()
const { data, status } = await verifyIdentity()

if (status !== 200) {
setLoading(false)
return;
return
}

const redirectUrl = data?.redirectUrl;
const redirectUrl = data?.redirectUrl
setLoading(false)
window.open(redirectUrl, '_self')
} catch (error) {
Expand Down

0 comments on commit 4f015c0

Please sign in to comment.