Skip to content

Commit f80c93c

Browse files
authored
Merge pull request #5 from ProjectIxian/jaka/fix/static-copy-footer
fix: static copy in the footer
2 parents 4a94675 + ea93cb1 commit f80c93c

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"use client";
2+
3+
import React, {useEffect, useState} from 'react';
4+
import Text from "@/components/Text/Text";
5+
import {useTranslations} from "next-intl";
6+
7+
const Copyright = () => {
8+
const [year, setYear] = useState(new Date().getFullYear());
9+
const t = useTranslations('Footer');
10+
11+
useEffect(() => {
12+
setYear(new Date().getFullYear());
13+
}, []);
14+
15+
return (
16+
<Text type={'caption-01'}>
17+
{t('copyright', {
18+
year: year?.toString(),
19+
})}
20+
</Text>
21+
);
22+
};
23+
24+
export default Copyright;

src/components/Footer/Footer.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import ContentWrapper from '@/components/ContentWrapper/ContentWrapper';
66
import Text from '@/components/Text/Text';
77
import Link from 'next/link';
88
import { Routes } from '@/contants/contants';
9+
import Copyright from "@/components/Copyright/Copyright";
910

1011
const Footer = () => {
1112
const t = useTranslations('Footer');
@@ -41,11 +42,7 @@ const Footer = () => {
4142
</div>
4243
<div className={classes.divider} />
4344
<div className={classes.copyright}>
44-
<Text type={'caption-01'}>
45-
{t('copyright', {
46-
year: new Date().getFullYear()?.toString(),
47-
})}
48-
</Text>
45+
<Copyright />
4946
<Link href={Routes.PP}>
5047
<Text type={'link'}>{t('privacyPolicy')}</Text>
5148
</Link>

0 commit comments

Comments
 (0)