-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Footer component and data handling
Refactor Footer components to use new SocialIconLink and Texts interfaces. Removed old text data file and replaced inline definitions for better modularity and translations.
- Loading branch information
Showing
10 changed files
with
110 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
frontend-next-migration/src/widgets/Footer/model/data/text.ts
This file was deleted.
Oops, something went wrong.
9 changes: 8 additions & 1 deletion
9
frontend-next-migration/src/widgets/Footer/model/types/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
export interface SocialLink { | ||
export interface SocialIconLink { | ||
name: string; | ||
icon: string; | ||
link: string; | ||
} | ||
|
||
export interface Texts { | ||
cookies: string; | ||
privacy: string; | ||
consent: string; | ||
currentYear: number; | ||
} |
18 changes: 17 additions & 1 deletion
18
frontend-next-migration/src/widgets/Footer/ui/FooterDesktop/FooterDesktop.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
import React from 'react'; | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import FooterDesktop from './FooterDesktop'; | ||
import {socialIconLinks} from "../../model/data/socialSectionMenu"; | ||
|
||
export default { | ||
title: 'widgets/Footer/Desktop', | ||
component: FooterDesktop, | ||
} as ComponentMeta<typeof FooterDesktop>; | ||
|
||
const Template: ComponentStory<typeof FooterDesktop> = () => ( | ||
<FooterDesktop/> | ||
<FooterDesktop | ||
socialLinks={socialIconLinks} | ||
title={"Be part of our community 😊"} | ||
texts={ | ||
{ | ||
consent: "Consent", | ||
cookies: "Cookies", | ||
privacy: "Privacy", | ||
currentYear: new Date().getFullYear(), | ||
} | ||
} | ||
/> | ||
); | ||
|
||
export const Default = Template.bind({}); | ||
|
||
|
||
// export const CurrentYear = new Date().getFullYear(); | ||
// export const CompanyName = "Psyche's Royale Gaming ry"; | ||
// export const Cookies = 'Cookies'; | ||
// export const Privacy = 'Privacy'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 17 additions & 3 deletions
20
frontend-next-migration/src/widgets/Footer/ui/FooterMain/FooterMain.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
import {useParams} from "next/navigation"; | ||
import FooterDesktop from "../FooterDesktop/FooterDesktop"; | ||
import useIsMobileSize from "@/shared/lib/hooks/useIsMobileSize"; | ||
import {socialIconLinks} from "../../model/data/socialSectionMenu"; | ||
import {useClientTranslation} from "@/shared/i18n"; | ||
|
||
|
||
export const Footer = () => { | ||
|
||
const {isMobileSize} = useIsMobileSize() | ||
const params = useParams(); | ||
const lng = params.lng as string; | ||
const {t} = useClientTranslation(lng, "footer"); | ||
|
||
return ( | ||
<FooterDesktop/> | ||
<FooterDesktop | ||
title={ | ||
t("FooterTitle") | ||
} | ||
texts={ | ||
{ | ||
|
||
} | ||
} | ||
socialIconLinks={socialIconLinks} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
frontend-next-migration/src/widgets/Footer/ui/SocialSection/SocialSection.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
frontend-next-migration/src/widgets/Footer/ui/Title/Title.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters