saafe-redirection-flow 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-and-deploy.yml +41 -0
- package/.gitlab-ci.yml +108 -0
- package/.releaserc.json +18 -0
- package/.storybook/main.ts +28 -0
- package/.storybook/preview.ts +16 -0
- package/.storybook/vitest.setup.ts +9 -0
- package/.vite/deps/@radix-ui_react-avatar.js +230 -0
- package/.vite/deps/@radix-ui_react-avatar.js.map +7 -0
- package/.vite/deps/@radix-ui_react-slot.js +12 -0
- package/.vite/deps/@radix-ui_react-slot.js.map +7 -0
- package/.vite/deps/_metadata.json +79 -0
- package/.vite/deps/chunk-5VGQBUCU.js +597 -0
- package/.vite/deps/chunk-5VGQBUCU.js.map +7 -0
- package/.vite/deps/chunk-DC5AMYBS.js +38 -0
- package/.vite/deps/chunk-DC5AMYBS.js.map +7 -0
- package/.vite/deps/chunk-HUIEPYH7.js +11265 -0
- package/.vite/deps/chunk-HUIEPYH7.js.map +7 -0
- package/.vite/deps/chunk-TKHB4QMX.js +281 -0
- package/.vite/deps/chunk-TKHB4QMX.js.map +7 -0
- package/.vite/deps/chunk-YLDSBLSF.js +1139 -0
- package/.vite/deps/chunk-YLDSBLSF.js.map +7 -0
- package/.vite/deps/class-variance-authority.js +63 -0
- package/.vite/deps/class-variance-authority.js.map +7 -0
- package/.vite/deps/lucide-react.js +36984 -0
- package/.vite/deps/lucide-react.js.map +7 -0
- package/.vite/deps/package.json +3 -0
- package/.vite/deps/react-dom_client.js +17917 -0
- package/.vite/deps/react-dom_client.js.map +7 -0
- package/.vite/deps/react-router-dom.js +452 -0
- package/.vite/deps/react-router-dom.js.map +7 -0
- package/.vite/deps/react-router.js +234 -0
- package/.vite/deps/react-router.js.map +7 -0
- package/.vite/deps/react.js +5 -0
- package/.vite/deps/react.js.map +7 -0
- package/.vite/deps/react_jsx-dev-runtime.js +470 -0
- package/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
- package/CHANGELOG.md +420 -0
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/RELEASE_CHEATSHEET.md +93 -0
- package/RELEASE_NOTES.md +120 -0
- package/components.json +21 -0
- package/docs/DEPLOYMENT_WORKFLOW.md +262 -0
- package/docs/RELEASE_GUIDE.md +591 -0
- package/docs/architecture.md +432 -0
- package/docs/components.md +199 -0
- package/docs/index.md +69 -0
- package/docs/local-release-workflow.md +234 -0
- package/docs/routes.md +118 -0
- package/docs/sdk-integration.md +325 -0
- package/docs/semantic-release.md +124 -0
- package/docs/user-flow.md +206 -0
- package/eslint.config.js +28 -0
- package/index.html +19 -0
- package/install.sh +198 -0
- package/package.json +115 -0
- package/public/images/bank-logo.png +0 -0
- package/public/saafe-icon.svg +9 -0
- package/src/App.tsx +171 -0
- package/src/__tests__/url-parameters.test.ts +82 -0
- package/src/assets/brand/applestore.svg +13 -0
- package/src/assets/brand/playstore.svg +23 -0
- package/src/assets/brand/saafe-color-white-logo.svg +14 -0
- package/src/assets/brand/saafe-icon.svg +9 -0
- package/src/assets/brand/saafe-logo.svg +18 -0
- package/src/assets/icons/check-icon-dark.svg +27 -0
- package/src/assets/icons/check-icon.svg +23 -0
- package/src/components/ErrorBoundary.tsx +132 -0
- package/src/components/alert/alert.tsx +27 -0
- package/src/components/auth/AuthGuard.tsx +76 -0
- package/src/components/cards/BankCard.stories.tsx +69 -0
- package/src/components/cards/BankCard.tsx +227 -0
- package/src/components/cards/OuterCard.tsx +109 -0
- package/src/components/cards/WrapperCard.tsx +64 -0
- package/src/components/documents/PrivacyContent.tsx +1 -0
- package/src/components/dummyFooter.tsx +29 -0
- package/src/components/icons/github.tsx +12 -0
- package/src/components/language/LanguageSwitcher.tsx +44 -0
- package/src/components/layouts/FrostedLayout.stories.tsx +42 -0
- package/src/components/layouts/FrostedLayout.tsx +333 -0
- package/src/components/layouts/MobileLayout.tsx +403 -0
- package/src/components/mobile-background.tsx +136 -0
- package/src/components/mobileAppDownload.tsx +30 -0
- package/src/components/modal/ModalComp.tsx +27 -0
- package/src/components/mode-toggle.tsx +36 -0
- package/src/components/page-header.tsx +50 -0
- package/src/components/session/SessionTimeoutScreen.tsx +134 -0
- package/src/components/session/SessionTimer.tsx +173 -0
- package/src/components/step-navigation.tsx +87 -0
- package/src/components/title/AppBar.stories.tsx +50 -0
- package/src/components/title/AppBar.tsx +150 -0
- package/src/components/title/SectionTitle.tsx +31 -0
- package/src/components/ui/AnimatedButton.module.css +13 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/animatedButton.tsx +111 -0
- package/src/components/ui/avatar.tsx +51 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/bottom-sheet.tsx +122 -0
- package/src/components/ui/button.tsx +59 -0
- package/src/components/ui/calendar.tsx +86 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/checkbox.stories.tsx +49 -0
- package/src/components/ui/checkbox.tsx +67 -0
- package/src/components/ui/collapsible.tsx +45 -0
- package/src/components/ui/dialog.tsx +134 -0
- package/src/components/ui/document-link.tsx +26 -0
- package/src/components/ui/dot-stepper.tsx +57 -0
- package/src/components/ui/dropdown-menu.tsx +255 -0
- package/src/components/ui/form.tsx +165 -0
- package/src/components/ui/frosted-panel.stories.tsx +86 -0
- package/src/components/ui/frosted-panel.tsx +276 -0
- package/src/components/ui/input.tsx +39 -0
- package/src/components/ui/label.stories.tsx +67 -0
- package/src/components/ui/label.tsx +23 -0
- package/src/components/ui/mobile-footer.tsx +54 -0
- package/src/components/ui/modal.tsx +90 -0
- package/src/components/ui/otp-input.stories.tsx +62 -0
- package/src/components/ui/otp-input.tsx +221 -0
- package/src/components/ui/platform-specific-behavior.tsx +28 -0
- package/src/components/ui/popover.tsx +46 -0
- package/src/components/ui/progress.tsx +103 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/sdk-params-docs.tsx +53 -0
- package/src/components/ui/select.tsx +159 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/sidebar.tsx +724 -0
- package/src/components/ui/skeleton.stories.tsx +50 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/components/ui/step.stories.tsx +132 -0
- package/src/components/ui/step.tsx +234 -0
- package/src/components/ui/stepper-progress.tsx +136 -0
- package/src/components/ui/stepper.tsx +259 -0
- package/src/components/ui/tabs.tsx +55 -0
- package/src/components/ui/tooltip.tsx +61 -0
- package/src/components/ui/url-decode-loader.tsx +36 -0
- package/src/components/ui/version-display.tsx +104 -0
- package/src/components/ui/web-footer.tsx +36 -0
- package/src/config/environments.ts +99 -0
- package/src/config/urls.ts +53 -0
- package/src/const/fiTypeCategoryMap.ts +19 -0
- package/src/contexts/LanguageContext.tsx +41 -0
- package/src/contexts/RTLContext.tsx +42 -0
- package/src/contexts/ThemeContext.tsx +93 -0
- package/src/hooks/use-account-discovery.ts +205 -0
- package/src/hooks/use-auth-query.ts +141 -0
- package/src/hooks/use-fip-query.ts +72 -0
- package/src/hooks/use-media-query.ts +32 -0
- package/src/hooks/use-mobile.ts +24 -0
- package/src/hooks/use-page-title.tsx +48 -0
- package/src/hooks/use-platform.ts +52 -0
- package/src/hooks/use-trusted-count.ts +21 -0
- package/src/hooks/use-url-decode.ts +90 -0
- package/src/hooks/useStep.ts +170 -0
- package/src/index.css +154 -0
- package/src/interfaces/app.interfaces.ts +39 -0
- package/src/interfaces/services.interfaces.ts +65 -0
- package/src/lib/i18n.ts +68 -0
- package/src/lib/utils.ts +6 -0
- package/src/locales/en/common.json +167 -0
- package/src/locales/hi/common.json +137 -0
- package/src/locales/kn/common.json +137 -0
- package/src/locales/ml/common.json +137 -0
- package/src/locales/ta/common.json +137 -0
- package/src/locales/te/common.json +137 -0
- package/src/locales/ur/common.json +138 -0
- package/src/main.tsx +46 -0
- package/src/pages/Login.tsx +363 -0
- package/src/pages/accounts/AccountsToProceed.tsx +396 -0
- package/src/pages/accounts/Discover.tsx +76 -0
- package/src/pages/accounts/DiscoverAccount.tsx +751 -0
- package/src/pages/accounts/LinkSelectedAccounts.tsx +638 -0
- package/src/pages/accounts/OldUser.tsx +329 -0
- package/src/pages/accounts/link-accounts.tsx +913 -0
- package/src/pages/consent/ReviewConsent.tsx +836 -0
- package/src/pages/consent/rejected.tsx +253 -0
- package/src/pages/consent/success.tsx +220 -0
- package/src/providers/query-provider.tsx +24 -0
- package/src/providers/toast-provider.tsx +26 -0
- package/src/services/api/account.service.ts +296 -0
- package/src/services/api/auth.service.ts +206 -0
- package/src/services/api/axios.ts +138 -0
- package/src/services/api/consent.service.ts +142 -0
- package/src/services/api/decode.service.ts +53 -0
- package/src/services/api/feedback.service.ts +34 -0
- package/src/services/api/fip.service.ts +187 -0
- package/src/services/api/index.ts +9 -0
- package/src/services/api/public.service.ts +18 -0
- package/src/services/api.ts +2 -0
- package/src/services/postMessage.service.ts +179 -0
- package/src/store/NavigationBlockContext.tsx +34 -0
- package/src/store/auth.store.ts +79 -0
- package/src/store/fip.store.ts +396 -0
- package/src/store/mandatoryConsent.store.ts +24 -0
- package/src/store/redirect.store.ts +73 -0
- package/src/store/step.store.ts +124 -0
- package/src/stories/Button.stories.ts +53 -0
- package/src/stories/Button.tsx +37 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.ts +33 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Page.stories.ts +32 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/styles/rtl-utils.css +90 -0
- package/src/styles/rtl.css +105 -0
- package/src/utils/api-error.ts +26 -0
- package/src/utils/cn.ts +10 -0
- package/src/utils/error-callback.ts +116 -0
- package/src/utils/formatAccountNumber.ts +9 -0
- package/src/utils/handleIdentifiers.ts +90 -0
- package/src/utils/posthog.ts +67 -0
- package/src/utils/toast-helpers.ts +61 -0
- package/src/vite-env.d.ts +1 -0
- package/stage-aa-2506251021.zip +0 -0
- package/tsconfig.app.json +33 -0
- package/tsconfig.json +13 -0
- package/tsconfig.node.json +24 -0
- package/vite.config.ts +45 -0
- package/vitest.shims.d.ts +1 -0
- package/vitest.workspace.ts +46 -0
@@ -0,0 +1,329 @@
|
|
1
|
+
import BankCard from '@/components/cards/BankCard'
|
2
|
+
import OuterCard from '@/components/cards/OuterCard'
|
3
|
+
import SectionTitle from '@/components/title/SectionTitle'
|
4
|
+
import { AnimatedButton } from '@/components/ui/animatedButton'
|
5
|
+
import { Button } from '@/components/ui/button'
|
6
|
+
import { Checkbox } from '@/components/ui/checkbox'
|
7
|
+
import { ScrollArea } from '@/components/ui/scroll-area'
|
8
|
+
import { accountService } from '@/services/api'
|
9
|
+
import { useQuery } from '@tanstack/react-query'
|
10
|
+
import { AlertCircle, PlusIcon } from 'lucide-react'
|
11
|
+
import React from 'react'
|
12
|
+
import { useRedirectStore } from '@/store/redirect.store'
|
13
|
+
import { FrostedLayout } from '@/components/layouts/FrostedLayout'
|
14
|
+
import { useFipStore } from '@/store/fip.store'
|
15
|
+
import { formatAccountNumber } from '@/utils/formatAccountNumber'
|
16
|
+
import { MobileFooter } from '@/components/ui/mobile-footer'
|
17
|
+
import WebFooter from '@/components/ui/web-footer'
|
18
|
+
import { useNavigate } from 'react-router-dom'
|
19
|
+
import { t } from 'i18next'
|
20
|
+
import { useAccountDiscovery } from '@/hooks/use-account-discovery'
|
21
|
+
import { Skeleton } from '@/components/ui/skeleton'
|
22
|
+
import { Alert, AlertDescription } from '@/components/ui/alert'
|
23
|
+
import { useSetPageTitle } from '@/hooks/use-page-title'
|
24
|
+
import { useNavigationBlock } from '@/store/NavigationBlockContext'
|
25
|
+
import DummyFooter from '@/components/dummyFooter'
|
26
|
+
import { useFipQuery } from '@/hooks/use-fip-query'
|
27
|
+
|
28
|
+
interface BankAccount {
|
29
|
+
linkRefNumber: string;
|
30
|
+
fiType: string;
|
31
|
+
bankName: string;
|
32
|
+
accountType: string;
|
33
|
+
maskedAccNumber: string;
|
34
|
+
logoUrl?: string;
|
35
|
+
fipHandle: string;
|
36
|
+
}
|
37
|
+
|
38
|
+
const OldUser = () => {
|
39
|
+
|
40
|
+
useSetPageTitle('Select accounts you want to share')
|
41
|
+
const { setSelectedAccountToLink, setFips, setSignature, setOriginalAccounts, accountForConsent, setAccountForConsent, activeCategory, categories } = useFipStore();
|
42
|
+
const { decodedInfo } = useRedirectStore();
|
43
|
+
const consentHandle = decodedInfo?.srcref || '';
|
44
|
+
const { shouldAllowNavigation } = useNavigationBlock();
|
45
|
+
const navigate = useNavigate();
|
46
|
+
|
47
|
+
// Fetch FIP data with React Query - use dynamic consent handle
|
48
|
+
const { refetch } = useFipQuery(consentHandle)
|
49
|
+
|
50
|
+
const getLinkedAccountsList = useQuery({
|
51
|
+
queryKey: ['linked-accounts', consentHandle, decodedInfo?.fipId],
|
52
|
+
queryFn: () => accountService.getLinkedAccounts(consentHandle, decodedInfo?.fipId),
|
53
|
+
enabled: !!consentHandle,
|
54
|
+
select: (data) => {
|
55
|
+
return data.map((account: BankAccount) => ({
|
56
|
+
...account,
|
57
|
+
bankName: account.fipName,
|
58
|
+
maskedAccountNumber: account.maskedAccNumber,
|
59
|
+
type: account.accountType,
|
60
|
+
id: account.accountRefNumber
|
61
|
+
}))
|
62
|
+
}
|
63
|
+
})
|
64
|
+
|
65
|
+
// Account discovery with enhanced error handling
|
66
|
+
const { mutate } = useAccountDiscovery()
|
67
|
+
|
68
|
+
// Group accounts by fiType
|
69
|
+
const groupedAccounts = React.useMemo(() => {
|
70
|
+
if (getLinkedAccountsList.isFetched && getLinkedAccountsList.data?.length === 0) {
|
71
|
+
shouldAllowNavigation()
|
72
|
+
navigate(`/link-accounts/${activeCategory ? activeCategory?.toLowerCase() : categories[0]?.toLowerCase()}`)
|
73
|
+
}
|
74
|
+
if (!getLinkedAccountsList?.data) return {};
|
75
|
+
|
76
|
+
const fipIdsArray = new Set(getLinkedAccountsList.data.map((account: BankAccount) => account.fipHandle));
|
77
|
+
setFips(Array.from(fipIdsArray));
|
78
|
+
let mounted = true
|
79
|
+
|
80
|
+
if (!accountForConsent?.length) {
|
81
|
+
setAccountForConsent([...new Set(getLinkedAccountsList.data.map((i => i?.linkRefNumber)))]);
|
82
|
+
}
|
83
|
+
|
84
|
+
mutate(Array.from(fipIdsArray), {
|
85
|
+
onSuccess: result => {
|
86
|
+
if (!mounted) return
|
87
|
+
const groupedAccounts = result.accounts.reduce(
|
88
|
+
(acc: Record<string, any[]>, account) => {
|
89
|
+
const key = account.type
|
90
|
+
if (!acc[key]) {
|
91
|
+
acc[key] = []
|
92
|
+
}
|
93
|
+
acc[key].push(account)
|
94
|
+
return acc
|
95
|
+
},
|
96
|
+
{}
|
97
|
+
)
|
98
|
+
setSignature(result.signature)
|
99
|
+
setOriginalAccounts(result.originalAccounts)
|
100
|
+
},
|
101
|
+
onError: () => {
|
102
|
+
if (!mounted) return
|
103
|
+
}
|
104
|
+
})
|
105
|
+
|
106
|
+
const accounts = getLinkedAccountsList.data;
|
107
|
+
return accounts.reduce((acc: any, account) => {
|
108
|
+
const fiType = account.fiType || 'Other';
|
109
|
+
if (!acc[fiType]) {
|
110
|
+
acc[fiType] = [];
|
111
|
+
}
|
112
|
+
acc[fiType].push(account);
|
113
|
+
return acc;
|
114
|
+
}, {});
|
115
|
+
}, [getLinkedAccountsList?.data]);
|
116
|
+
|
117
|
+
const toggleBankSelection = (bankId: string) => {
|
118
|
+
setAccountForConsent(accountForConsent.includes(bankId)
|
119
|
+
? accountForConsent.filter(id => id !== bankId)
|
120
|
+
: [...accountForConsent, bankId]
|
121
|
+
);
|
122
|
+
};
|
123
|
+
|
124
|
+
const handleProceed = () => {
|
125
|
+
setSelectedAccountToLink(
|
126
|
+
getLinkedAccountsList?.data?.filter(account =>
|
127
|
+
accountForConsent.includes(account.linkRefNumber)
|
128
|
+
) || []
|
129
|
+
)
|
130
|
+
// Navigate to account linking screen with selected accounts and signature
|
131
|
+
navigate('/review', {
|
132
|
+
state: {
|
133
|
+
selectedFips: accountForConsent,
|
134
|
+
}
|
135
|
+
})
|
136
|
+
}
|
137
|
+
|
138
|
+
const handleCancel = () => {
|
139
|
+
// Deselect all selected accounts
|
140
|
+
setAccountForConsent([]);
|
141
|
+
}
|
142
|
+
|
143
|
+
const handleSelectAll = (fiType: string) => {
|
144
|
+
const accounts = groupedAccounts[fiType] || [];
|
145
|
+
const allAccountRefs = accounts.map((account: BankAccount) => account.linkRefNumber);
|
146
|
+
|
147
|
+
// Check if all accounts in this group are already selected
|
148
|
+
const areAllSelected = allAccountRefs.every((ref: string) => accountForConsent.includes(ref));
|
149
|
+
|
150
|
+
if (areAllSelected) {
|
151
|
+
// If all are selected, deselect all accounts in this group
|
152
|
+
setAccountForConsent(accountForConsent.filter(ref => !allAccountRefs.includes(ref)));
|
153
|
+
} else {
|
154
|
+
// If not all are selected, select all accounts in this group
|
155
|
+
setAccountForConsent([...new Set([...accountForConsent, ...allAccountRefs])]);
|
156
|
+
}
|
157
|
+
};
|
158
|
+
|
159
|
+
return (
|
160
|
+
<FrostedLayout>
|
161
|
+
<div className='w-full px-0 md:px-14'>
|
162
|
+
<div>
|
163
|
+
{(() => {
|
164
|
+
if (getLinkedAccountsList?.isLoading) {
|
165
|
+
return (
|
166
|
+
<div className='flex flex-col gap-4 md:mt-6 mt-0'>
|
167
|
+
<Skeleton className='h-8 w-[24%]' />
|
168
|
+
{Array(3)
|
169
|
+
.fill(0)
|
170
|
+
.map((_, index) => (
|
171
|
+
<OuterCard key={`loading-${index}`} selected={false} loading={true}>
|
172
|
+
<BankCard bankName='' />
|
173
|
+
</OuterCard>
|
174
|
+
))}
|
175
|
+
<Skeleton className='h-16 w-full mt-3' />
|
176
|
+
</div>
|
177
|
+
);
|
178
|
+
}
|
179
|
+
|
180
|
+
if (getLinkedAccountsList?.data && getLinkedAccountsList.data.length > 0) {
|
181
|
+
return Object.keys(groupedAccounts).map((fiType) => (
|
182
|
+
<div key={fiType}>
|
183
|
+
<SectionTitle
|
184
|
+
title={fiType}
|
185
|
+
className="md:mt-6 mt-0"
|
186
|
+
rightSection={
|
187
|
+
<AnimatedButton
|
188
|
+
variant={'text'}
|
189
|
+
size={'text'}
|
190
|
+
className='text-primary'
|
191
|
+
onClick={() => handleSelectAll(fiType)}
|
192
|
+
>
|
193
|
+
{groupedAccounts[fiType]?.every((account: BankAccount) =>
|
194
|
+
accountForConsent.includes(account.linkRefNumber)
|
195
|
+
) ? 'Deselect All' : 'Select All'}
|
196
|
+
</AnimatedButton>
|
197
|
+
}
|
198
|
+
/>
|
199
|
+
<ScrollArea className='max-h-[40vh] overflow-y-auto'>
|
200
|
+
{groupedAccounts[fiType]?.map((account: BankAccount) => (
|
201
|
+
<div className='mt-2 flex flex-col gap-2' key={account.linkRefNumber}>
|
202
|
+
<OuterCard
|
203
|
+
selected={accountForConsent.includes(account.linkRefNumber)}
|
204
|
+
onSelect={() => toggleBankSelection(account.linkRefNumber)}>
|
205
|
+
<BankCard
|
206
|
+
bankName={account.bankName}
|
207
|
+
image={account.logoUrl}
|
208
|
+
subText={`${account.accountType} | **${formatAccountNumber(account.maskedAccNumber)}`}
|
209
|
+
rightSection={
|
210
|
+
<Checkbox
|
211
|
+
id={`checkbox-${account.linkRefNumber}`}
|
212
|
+
checked={accountForConsent.includes(account.linkRefNumber)}
|
213
|
+
onCheckedChange={() => toggleBankSelection(account.linkRefNumber)}
|
214
|
+
/>
|
215
|
+
}
|
216
|
+
/>
|
217
|
+
</OuterCard>
|
218
|
+
</div>
|
219
|
+
))}
|
220
|
+
</ScrollArea>
|
221
|
+
<Button
|
222
|
+
variant={'outline'}
|
223
|
+
className='bg-primary-foreground text-primary border-primary hover:bg-primary/10 h-[50px] w-full mt-4 mb-6'
|
224
|
+
onClick={() => {
|
225
|
+
refetch()
|
226
|
+
navigate(`/link-accounts/${fiType.toLowerCase()}`, {
|
227
|
+
state: {
|
228
|
+
fiType,
|
229
|
+
}
|
230
|
+
});
|
231
|
+
setAccountForConsent([])
|
232
|
+
}}
|
233
|
+
size={'lg'}
|
234
|
+
>
|
235
|
+
<div className='flex items-center gap-2 text-md text-primary font-[600] dark:text-muted-secondary'>
|
236
|
+
<PlusIcon
|
237
|
+
strokeWidth='2.3'
|
238
|
+
className='size-5 text-primary dark:text-muted-secondary'
|
239
|
+
/>{' '}
|
240
|
+
{t('discoverMore')}
|
241
|
+
</div>
|
242
|
+
</Button>
|
243
|
+
</div>
|
244
|
+
));
|
245
|
+
}
|
246
|
+
|
247
|
+
return (
|
248
|
+
<>
|
249
|
+
<Alert variant='destructive' className='mb-4 mt-12'>
|
250
|
+
<AlertCircle className='h-4 w-4 mt-1' />
|
251
|
+
<AlertDescription className='flex items-center justify-between'>
|
252
|
+
Failed to find linked accounts
|
253
|
+
<Button
|
254
|
+
variant='outline'
|
255
|
+
size='sm'
|
256
|
+
className='ml-2'
|
257
|
+
onClick={() => {
|
258
|
+
getLinkedAccountsList.refetch()
|
259
|
+
}}
|
260
|
+
>
|
261
|
+
Retry
|
262
|
+
</Button>
|
263
|
+
</AlertDescription>
|
264
|
+
</Alert>
|
265
|
+
<Button
|
266
|
+
variant={'secondary'}
|
267
|
+
className='bg-gray-200 dark:bg-gray-800 text-gray-700 hover:bg-gray-300 h-[50px] w-full mt-4'
|
268
|
+
onClick={() => {
|
269
|
+
refetch()
|
270
|
+
navigate(`/link-accounts/${completedCategories?.[completedCategories.length - 1]}`);
|
271
|
+
}}
|
272
|
+
size={'lg'}
|
273
|
+
>
|
274
|
+
<div className='flex items-center gap-2 text-md text-consent-primary font-[600] capitalize'>
|
275
|
+
<PlusIcon
|
276
|
+
strokeWidth='2.3'
|
277
|
+
className='size-5 text-consent-primary'
|
278
|
+
/>{' '}
|
279
|
+
{t('discover')}
|
280
|
+
</div>
|
281
|
+
</Button>
|
282
|
+
</>
|
283
|
+
);
|
284
|
+
})()}
|
285
|
+
</div>
|
286
|
+
<DummyFooter />
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<MobileFooter show={accountForConsent.length > 0}>
|
290
|
+
<div className='flex flex-col items-center w-full gap-4'>
|
291
|
+
<AnimatedButton
|
292
|
+
onClick={handleProceed}
|
293
|
+
size='lg'
|
294
|
+
className='w-full h-[50px]'
|
295
|
+
>
|
296
|
+
{t('proceed')}
|
297
|
+
</AnimatedButton>
|
298
|
+
<AnimatedButton
|
299
|
+
onClick={handleCancel}
|
300
|
+
variant={'ghost'}
|
301
|
+
size='lg'
|
302
|
+
className='text-primary'
|
303
|
+
>
|
304
|
+
{t('cancel')}
|
305
|
+
</AnimatedButton>
|
306
|
+
</div>
|
307
|
+
</MobileFooter>
|
308
|
+
|
309
|
+
<WebFooter show={accountForConsent.length > 0}>
|
310
|
+
<AnimatedButton
|
311
|
+
onClick={handleCancel}
|
312
|
+
variant={'ghost'}
|
313
|
+
size='lg'
|
314
|
+
className='text-primary'
|
315
|
+
>
|
316
|
+
Cancel
|
317
|
+
</AnimatedButton>
|
318
|
+
<AnimatedButton
|
319
|
+
onClick={handleProceed}
|
320
|
+
size='lg'
|
321
|
+
>
|
322
|
+
Proceed
|
323
|
+
</AnimatedButton>
|
324
|
+
</WebFooter>
|
325
|
+
</FrostedLayout>
|
326
|
+
)
|
327
|
+
}
|
328
|
+
|
329
|
+
export default OldUser
|