feat: welcome page title and club banner added

This commit is contained in:
2025-08-18 23:16:00 +03:30
parent 8e9486f1e5
commit c8ffd34f15
12 changed files with 164 additions and 2 deletions

View File

@@ -0,0 +1,58 @@
import React, { useMemo, useState } from 'react';
import { AuthenticationCard } from '../AuthenticationCard';
import { Box, CardHeader, Divider, Stack, Typography } from '@mui/material';
import AccountCreatedIcon from '@/assets/account-created.svg';
import { useTranslation } from 'react-i18next';
import { Link as RouterLink, useSearchParams } from 'react-router-dom';
import Link from '@mui/material/Link';
import { AccountCreatedClubBanner } from './AccountCreatedClubBanner';
type RequestedApplication = 'default' | 'unknown' | 'club';
export const AccountCreated = () => {
const { t } = useTranslation('authentication');
const [params] = useSearchParams();
// Checking if there is a requested application and if its club or any other url
const requestedApplication = useMemo<RequestedApplication>(() => {
const returnUrl = params.get('returnUrl');
if (!returnUrl) return 'default';
if (returnUrl.includes('https://club.business-harmony.com/')) {
return 'club';
}
return 'unknown';
}, [params]);
return (
<AuthenticationCard maxWidth="636px">
<Stack sx={{ alignItems: 'center' }}>
<img src={AccountCreatedIcon} />
<Typography variant="h5" sx={{ mt: 2 }}>
{t('accountCreated.yourHarmonyAccountHasBeenSuccessfullyCreated')}
</Typography>
<Typography variant="body2" sx={{ mt: 1, mb: 2 }}>
{t('accountCreated.yourAccountInformationCanBeChangedThrough')}
<Link component={RouterLink} to="/setting/profile" underline="always">
{t('accountCreated.accountSettings')}
</Link>
{t('accountCreated.yourAccountInformationCanBeChangedThroughEnd')}
</Typography>
</Stack>
{requestedApplication !== 'default' && (
<Box sx={{ mx: 7 }}>
<Divider sx={{ my: 2 }} />
{requestedApplication === 'club' && <AccountCreatedClubBanner />}
</Box>
)}
</AuthenticationCard>
);
};

View File

@@ -0,0 +1,25 @@
import { Stack, Typography, useTheme } from '@mui/material';
import { Icon } from '@rkheftan/harmony-ui';
import { Box, Profile2User } from 'iconsax-react';
import React from 'react';
import { useTranslation } from 'react-i18next';
export const AccountCreatedClubBanner = () => {
const { t } = useTranslation('authentication');
const theme = useTheme();
return (
<Stack direction="row" sx={{ py: 2.5 }} spacing={2} alignItems="start">
<Profile2User size={80} color={theme.palette.club.main} />
<Stack spacing={0.5}>
<Typography variant="h6">{t('accountCreated.harmonyClub')}</Typography>
<Typography variant="body2">
{t(
'accountCreated.encourageYourBusinessCustomersToMakeRepeatPurchasesBySendingThemDiscountCodesAndPoints',
)}
</Typography>
</Stack>
</Stack>
);
};