Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/app/(mobile-ui)/add-money/[country]/bank/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@

useEffect(() => {
fetchUser()
}, [])

Check warning on line 166 in src/app/(mobile-ui)/add-money/[country]/bank/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'fetchUser'. Either include it or remove the dependency array

Check warning on line 166 in src/app/(mobile-ui)/add-money/[country]/bank/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'fetchUser'. Either include it or remove the dependency array

const peanutWalletBalance = useMemo(() => {
return balance !== undefined ? formatAmount(formatUnits(balance, PEANUT_WALLET_TOKEN_DECIMALS)) : ''
Expand Down Expand Up @@ -515,7 +515,7 @@
message={pendingModal.message}
/>

<SumsubKycModals flow={sumsubFlow} autoStartSdk />
<SumsubKycModals flow={sumsubFlow} />

<BridgeTosStep
visible={showBridgeTos}
Expand Down
1 change: 0 additions & 1 deletion src/app/(mobile-ui)/qr-pay/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
if (sumsubFlow.showWrapper || sumsubFlow.isModalOpen) {
sumsubFlow.completeFlow()
}
}, [kycGateState, sumsubFlow.showWrapper, sumsubFlow.isModalOpen, sumsubFlow.completeFlow])

Check warning on line 253 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'sumsubFlow'. Either include it or remove the dependency array

Check warning on line 253 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'sumsubFlow'. Either include it or remove the dependency array

const queryClient = useQueryClient()
const [isShaking, setIsShaking] = useState(false)
Expand Down Expand Up @@ -361,7 +361,7 @@
if (isSuccess || !!errorMessage) {
setLoadingState('Idle')
}
}, [isSuccess, errorMessage])

Check warning on line 364 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'setLoadingState'. Either include it or remove the dependency array

Check warning on line 364 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'setLoadingState'. Either include it or remove the dependency array

// First fetch for qrcode info — only after KYC gating allows proceeding
useEffect(() => {
Expand All @@ -380,7 +380,7 @@
}

setIsFirstLoad(false)
}, [timestamp, paymentProcessor, qrCode])

Check warning on line 383 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'resetState'. Either include it or remove the dependency array

Check warning on line 383 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'resetState'. Either include it or remove the dependency array

// Get amount from payment lock (Manteca)
useEffect(() => {
Expand All @@ -395,7 +395,7 @@
setAmount(paymentLock.paymentAgainstAmount)
setCurrencyAmount(paymentLock.paymentAssetAmount)
}
}, [paymentLock?.code, paymentProcessor])

Check warning on line 398 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'paymentLock'. Either include it or remove the dependency array

Check warning on line 398 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'paymentLock'. Either include it or remove the dependency array

// Get currency object from payment lock (Manteca)
useEffect(() => {
Expand All @@ -417,7 +417,7 @@
}
}
getCurrencyObject().then(setCurrency)
}, [paymentLock?.code, paymentProcessor])

Check warning on line 420 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'paymentLock'. Either include it or remove the dependency array

Check warning on line 420 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has a missing dependency: 'paymentLock'. Either include it or remove the dependency array

const isBlockingError = useMemo(() => {
// The settling failure says "try again in a few seconds" — keep the Pay
Expand All @@ -439,7 +439,7 @@
// For dynamic QR codes, backend provides the USD amount
return paymentLock.paymentAgainstAmount
}
}, [paymentLock?.code, paymentLock?.paymentAgainstAmount, amount])

Check warning on line 442 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useMemo has a missing dependency: 'paymentLock'. Either include it or remove the dependency array

Check warning on line 442 in src/app/(mobile-ui)/qr-pay/page.tsx

View workflow job for this annotation

GitHub Actions / eslint

React Hook useMemo has a missing dependency: 'paymentLock'. Either include it or remove the dependency array

// Live card-vs-local-rail markup, driven by Manteca's rate + (for ARS)
// BCRA's official rate. Used by both the confirm-screen "Save vs card"
Expand Down Expand Up @@ -1471,7 +1471,6 @@
onClose={qrLimitIncreaseFlow.handleClose}
onComplete={qrLimitIncreaseFlow.handleSdkComplete}
onRefreshToken={qrLimitIncreaseFlow.refreshToken}
autoStart
isMultiLevel
/>
<div className={`flex min-h-[inherit] flex-col gap-8 ${getShakeClass(isShaking, shakeIntensity)}`}>
Expand Down
1 change: 0 additions & 1 deletion src/app/(mobile-ui)/withdraw/manteca/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ function MantecaBankWithdrawFlow() {
onClose={limitIncreaseFlow.handleClose}
onComplete={limitIncreaseFlow.handleSdkComplete}
onRefreshToken={limitIncreaseFlow.refreshToken}
autoStart
isMultiLevel
/>
<NavHeader
Expand Down
3 changes: 1 addition & 2 deletions src/components/Card/cardApply.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
* aborted so the caller can show a retry message (or stop entirely).
*
* Without this, the immediate post-Sumsub re-apply races against Sumsub and
* dumps the user back on the "Start Secure Verification" interstitial when
* the WebSDK re-opens against an already-approved applicant. The signal lets
* re-opens the WebSDK against an already-approved applicant. The signal lets
* the caller stop the loop on unmount so we don't burn 15 sequential fetches
* after the user navigates away from the pending screen.
*/
Expand Down
53 changes: 0 additions & 53 deletions src/components/Global/IframeWrapper/StartVerificationView.tsx

This file was deleted.

82 changes: 36 additions & 46 deletions src/components/Global/IframeWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Modal from '../Modal'
import { Icon, type IconName } from '../Icons/Icon'
import ActionModal from '../ActionModal'
import { useRouter } from 'next/navigation'
import StartVerificationView from './StartVerificationView'
import { useModalsContext } from '@/context/ModalsContext'
import { Button, type ButtonVariant } from '@/components/0_Bruddle/Button'

Expand All @@ -12,15 +11,13 @@ export type IFrameWrapperProps = {
visible: boolean
onClose: (source?: 'manual' | 'completed' | 'tos_accepted') => void
closeConfirmMessage?: string
skipStartView?: boolean
}

const IframeWrapper = ({ src, visible, onClose, closeConfirmMessage, skipStartView }: IFrameWrapperProps) => {
const IframeWrapper = ({ src, visible, onClose, closeConfirmMessage }: IFrameWrapperProps) => {
const enableConfirmationPrompt = closeConfirmMessage !== undefined
const [isHelpModalOpen, setIsHelpModalOpen] = useState(false)
const [modalVariant, setModalVariant] = useState<'stop-verification' | 'trouble'>('trouble')
const [copied, setCopied] = useState(false)
const [isVerificationStarted, setIsVerificationStarted] = useState(skipStartView ?? false)
const router = useRouter()
const { setIsSupportModalOpen } = useModalsContext()

Expand Down Expand Up @@ -72,8 +69,8 @@ const IframeWrapper = ({ src, visible, onClose, closeConfirmMessage, skipStartVi
}

return {
title: 'Exit and lose progress?',
description: 'If you exit now, you’ll need to start the ID check again from scratch.',
title: 'Exit for now?',
description: 'You can come back and finish this anytime.',
icon: 'alert' as IconName,
iconContainerClassName: 'bg-secondary-1',
ctas: [
Expand Down Expand Up @@ -135,49 +132,42 @@ const IframeWrapper = ({ src, visible, onClose, closeConfirmMessage, skipStartVi
preventClose={true}
hideOverlay={false}
>
{!isVerificationStarted ? (
<StartVerificationView
onClose={() => onClose('manual')}
onStartVerification={() => setIsVerificationStarted(true)}
/>
) : (
<div className="flex h-full flex-col gap-2 p-0">
<div className="h-full w-full flex-grow overflow-scroll">
<iframe
key={src}
src={src}
allow="camera *; microphone *; fullscreen *"
style={{ width: '100%', height: '85%', border: 'none' }}
className="rounded-md"
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-top-navigation-by-user-activation allow-media-devices"
/>
<div className="flex h-[15%] w-full flex-col items-center justify-center gap-2 px-5">
<Button
variant={'transparent'}
className={`h-8 max-w-md font-normal underline`}
onClick={() => {
setModalVariant('stop-verification')
setIsHelpModalOpen(true)
}}
shadowType="primary"
>
Stop verification process
</Button>
<div className="flex h-full flex-col gap-2 p-0">
<div className="h-full w-full flex-grow overflow-scroll">
<iframe
key={src}
src={src}
allow="camera *; microphone *; fullscreen *"
style={{ width: '100%', height: '85%', border: 'none' }}
className="rounded-md"
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-top-navigation-by-user-activation allow-media-devices"
/>
<div className="flex h-[15%] w-full flex-col items-center justify-center gap-2 px-5">
<Button
variant={'transparent'}
className={`h-8 max-w-md font-normal underline`}
onClick={() => {
setModalVariant('stop-verification')
setIsHelpModalOpen(true)
}}
shadowType="primary"
>
Stop verification process
</Button>

<button
onClick={() => {
setModalVariant('trouble')
setIsHelpModalOpen(true)
}}
className="flex items-center gap-1"
>
<Icon name="peanut-support" size={16} className="text-grey-1" />
<p className="text-xs font-medium text-grey-1 underline">Having trouble?</p>
</button>
</div>
<button
onClick={() => {
setModalVariant('trouble')
setIsHelpModalOpen(true)
}}
className="flex items-center gap-1"
>
<Icon name="peanut-support" size={16} className="text-grey-1" />
<p className="text-xs font-medium text-grey-1 underline">Having trouble?</p>
</button>
</div>
</div>
)}
</div>
<ActionModal
visible={isHelpModalOpen}
onClose={() => setIsHelpModalOpen(false)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Kyc/BridgeTosStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const BridgeTosStep = ({ visible, onComplete, onSkip, reasonCode }: Bridg
]}
/>

{tosLink && <IframeWrapper src={tosLink} visible={showIframe} onClose={handleIframeClose} skipStartView />}
{tosLink && <IframeWrapper src={tosLink} visible={showIframe} onClose={handleIframeClose} />}
</>
)
}
2 changes: 1 addition & 1 deletion src/components/Kyc/KycStatusDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const KycStatusDrawer = ({ isOpen, onClose, onKeepMounted }: KycStatusDra
{sumsubFlow.error && <p className="text-red-500 mt-3 text-center text-sm">{sumsubFlow.error}</p>}
</DrawerContent>
</Drawer>
<SumsubKycModals flow={sumsubFlow} autoStartSdk />
<SumsubKycModals flow={sumsubFlow} />
</>
)
}
11 changes: 2 additions & 9 deletions src/components/Kyc/SumsubKycModals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { type useMultiPhaseKycFlow } from '@/hooks/useMultiPhaseKycFlow'

interface SumsubKycModalsProps {
flow: ReturnType<typeof useMultiPhaseKycFlow>
autoStartSdk?: boolean
}

/**
Expand All @@ -15,7 +14,7 @@ interface SumsubKycModalsProps {
*
* pair with useMultiPhaseKycFlow hook for the logic.
*/
export const SumsubKycModals = ({ flow, autoStartSdk }: SumsubKycModalsProps) => {
export const SumsubKycModals = ({ flow }: SumsubKycModalsProps) => {
return (
<>
<SumsubKycWrapper
Expand All @@ -24,7 +23,6 @@ export const SumsubKycModals = ({ flow, autoStartSdk }: SumsubKycModalsProps) =>
onClose={flow.handleSdkClose}
onComplete={flow.handleSdkComplete}
onRefreshToken={flow.refreshToken}
autoStart={autoStartSdk}
isMultiLevel={flow.isMultiLevel}
/>

Expand All @@ -42,12 +40,7 @@ export const SumsubKycModals = ({ flow, autoStartSdk }: SumsubKycModalsProps) =>
/>

{flow.tosLink && (
<IframeWrapper
src={flow.tosLink}
visible={flow.showTosIframe}
onClose={flow.handleTosIframeClose}
skipStartView
/>
<IframeWrapper src={flow.tosLink} visible={flow.showTosIframe} onClose={flow.handleTosIframeClose} />
)}
</>
)
Expand Down
Loading
Loading