Skip to content

Commit 2a16182

Browse files
committed
feat: add phone number to footer
1 parent d0102db commit 2a16182

File tree

6 files changed

+55
-26
lines changed

6 files changed

+55
-26
lines changed

src/components/Footer/components/DesktopFooter.tsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { FC } from 'react';
1919
import BadgeImage from './BadgeImage';
2020
import Newsletter from './Newsletter';
2121
import SocialMedia from './SocialMedia';
22+
import { phoneNumber } from '@/config/app';
23+
import { getPhoneNumber } from '@/utils/number';
2224

2325
export interface FooterProps {
2426
pages: IPageListItem[];
@@ -66,8 +68,34 @@ const Footer: FC<FooterProps> = ({ pages }) => {
6668
>
6769
<Container maxWidth="xl">
6870
<Stack spacing={4}>
69-
<Stack direction="row" justifyContent="space-between">
70-
<Logo />
71+
<Stack
72+
direction="row"
73+
justifyContent="space-between"
74+
alignItems="flex-start"
75+
>
76+
<Stack spacing={2}>
77+
<Logo />
78+
<Stack spacing={2} direction="row" alignItems="center">
79+
<Typography
80+
variant="body2"
81+
component={Link}
82+
href={`tel:${getPhoneNumber(phoneNumber)}`}
83+
color="text.primary"
84+
>
85+
{t.rich('footer.support.phoneNumber', {
86+
span: () => (
87+
<Box component="span" letterSpacing={1.5} dir="ltr">
88+
{phoneNumber}
89+
</Box>
90+
),
91+
})}
92+
</Typography>
93+
<span>|</span>
94+
<Typography variant="body2" color="text.primary">
95+
{t('footer.support.customerServiceHours:')}
96+
</Typography>
97+
</Stack>
98+
</Stack>
7199
<Button
72100
onClick={backToTop}
73101
variant="outlined"
@@ -89,7 +117,7 @@ const Footer: FC<FooterProps> = ({ pages }) => {
89117
</Stack>
90118

91119
<Stack spacing={1}>
92-
<Typography variant="h6">لینک های مفید</Typography>
120+
<Typography variant="h6">{t('footer.links.title')}</Typography>
93121
<Stack spacing={1}>
94122
{pages.map((page) => {
95123
return (

src/components/Footer/components/SocialMedia.tsx

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import FilledBale from '@/components/Icons/components/Use/FilledBale';
2-
import { Email, Instagram, Phone, Telegram } from '@mui/icons-material';
1+
import { Instagram, Telegram } from '@mui/icons-material';
32
import { Stack, Tooltip, Typography } from '@mui/material';
43
import { useTranslations } from 'next-intl';
54
import SocialMediaButton from './SocialMediaButton';
@@ -9,31 +8,13 @@ const socialMediaButtons = [
98
id: 'instagram',
109
title: 'Instagram',
1110
icon: <Instagram />,
12-
link: '#',
11+
link: 'https://instagram.com',
1312
},
1413
{
1514
id: 'telegram',
1615
title: 'Telegram',
1716
icon: <Telegram />,
18-
link: '#',
19-
},
20-
{
21-
id: 'bale',
22-
title: 'Bale',
23-
icon: <FilledBale />,
24-
link: '#',
25-
},
26-
{
27-
id: 'phone',
28-
title: 'Phone',
29-
icon: <Phone />,
30-
link: '#',
31-
},
32-
{
33-
id: 'email',
34-
title: 'Email',
35-
icon: <Email />,
36-
link: '#',
17+
link: 'https://telegram.me/',
3718
},
3819
];
3920

@@ -42,7 +23,7 @@ const SocialMedia = () => {
4223

4324
return (
4425
<Stack spacing={1}>
45-
<Typography variant="h6">{t('footer.links.contactUs')}</Typography>
26+
<Typography variant="h6">{t('footer.socialMedia.stayTuned')}</Typography>
4627
<Stack direction="row" spacing={1}>
4728
{socialMediaButtons.map((button) => {
4829
return (

src/config/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export const protectedRoutes = ['/profile', '/checkout'];
22
export const PUBLIC_GATEWAY_URL = '/backend';
3+
export const phoneNumber = '021 - 66112233';

src/data/i18n/en.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@
7676
"submit": "Submit"
7777
},
7878
"footer": {
79+
"support": {
80+
"phoneNumber": "PhoneNumber <span></span>",
81+
"customerServiceHours:": "Customer Service Hours:"
82+
},
83+
"socialMedia": {
84+
"stayTuned": "Stay Tuned!"
85+
},
7986
"links": {
87+
"title": "Useful Links",
8088
"aboutUs": "About Us",
8189
"contactUs": "Contact Us"
8290
},

src/data/i18n/fa.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@
7272
"submit": "ثبت"
7373
},
7474
"footer": {
75+
"support": {
76+
"phoneNumber": "تلفن پشتیبانی <span></span>",
77+
"customerServiceHours:": "شنبه تا پنجشنبه ساعت 9 تا 18"
78+
},
79+
"socialMedia": {
80+
"stayTuned": "با ما همراه باشید!"
81+
},
7582
"links": {
83+
"title": "لینک‌های مفید",
7684
"aboutUs": "درباره ما",
7785
"contactUs": "تماس با ما"
7886
},

src/utils/number.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const getPhoneNumber = (phoneNumber: string): string => {
2+
return phoneNumber.replace(/\D/g, '');
3+
};

0 commit comments

Comments
 (0)