feat: account created page redirect button added, navigate logic created, refresh token bug fix

This commit is contained in:
مهرزاد قدرتی
2025-08-19 16:46:58 +03:30
parent c8ffd34f15
commit 6ff25c69f2
12 changed files with 430 additions and 36 deletions

View File

@@ -6,8 +6,9 @@ import { useTranslation } from 'react-i18next';
import { Link as RouterLink, useSearchParams } from 'react-router-dom';
import Link from '@mui/material/Link';
import { AccountCreatedClubBanner } from './AccountCreatedClubBanner';
import { AccountCreatedRedirectButton } from './AccountCreatedRedirectButton';
type RequestedApplication = 'default' | 'unknown' | 'club';
export type RequestedApplication = 'default' | 'unknown' | 'club';
export const AccountCreated = () => {
const { t } = useTranslation('authentication');
@@ -19,13 +20,21 @@ export const AccountCreated = () => {
if (!returnUrl) return 'default';
if (returnUrl.includes('https://club.business-harmony.com/')) {
if (returnUrl.includes('club.business-harmony.com')) {
return 'club';
}
return 'unknown';
}, [params]);
const handleRedirectUser = () => {
const returnUrl = params.get('returnUrl');
if (returnUrl) {
location.href = returnUrl;
}
};
return (
<AuthenticationCard maxWidth="636px">
<Stack sx={{ alignItems: 'center' }}>
@@ -50,7 +59,14 @@ export const AccountCreated = () => {
<Box sx={{ mx: 7 }}>
<Divider sx={{ my: 2 }} />
{requestedApplication === 'club' && <AccountCreatedClubBanner />}
<Box sx={{ py: 2.5 }}>
{requestedApplication === 'club' && <AccountCreatedClubBanner />}
<AccountCreatedRedirectButton
onRedirectUser={handleRedirectUser}
requestedApplication={requestedApplication}
/>
</Box>
</Box>
)}
</AuthenticationCard>