From c8b767e4a629b5afbc5e0f401e80524e0b24fbca Mon Sep 17 00:00:00 2001 From: dbrosio3 Date: Thu, 26 May 2022 18:18:39 +0200 Subject: [PATCH] improved footer components --- src/components/Footer/FooterContainer.tsx | 3 +- src/components/Footer/LinksColumn.tsx | 24 +++++++ src/components/Footer/LinksSection.tsx | 73 ++++++--------------- src/components/Footer/NewsletterSection.tsx | 2 +- 4 files changed, 47 insertions(+), 55 deletions(-) create mode 100644 src/components/Footer/LinksColumn.tsx diff --git a/src/components/Footer/FooterContainer.tsx b/src/components/Footer/FooterContainer.tsx index fa413a4..51cd00d 100644 --- a/src/components/Footer/FooterContainer.tsx +++ b/src/components/Footer/FooterContainer.tsx @@ -3,7 +3,8 @@ import { chakra, Flex } from '@chakra-ui/react'; export const FooterContainer = chakra(Flex, { baseStyle: { width: '100%', - padding: 4, + px: 9, + py: 4, backgroundColor: 'secondary.main', }, }); diff --git a/src/components/Footer/LinksColumn.tsx b/src/components/Footer/LinksColumn.tsx new file mode 100644 index 0000000..c653b8e --- /dev/null +++ b/src/components/Footer/LinksColumn.tsx @@ -0,0 +1,24 @@ +import React from 'react'; + +import { GridItem, Heading, Text, VStack } from '@chakra-ui/react'; +import { useTranslation } from 'react-i18next'; + +export const LinksColumn: React.FC<{ sectionKey: string; links: Array }> = ({ + sectionKey, + links, +}) => { + const { t } = useTranslation(); + + return ( + + + + {t(`footer.${sectionKey}.title`)} + + {links.map(link => ( + {t(`footer.${sectionKey}.${link}`)} + ))} + + + ); +}; diff --git a/src/components/Footer/LinksSection.tsx b/src/components/Footer/LinksSection.tsx index b8ad1c7..4f6ae13 100644 --- a/src/components/Footer/LinksSection.tsx +++ b/src/components/Footer/LinksSection.tsx @@ -1,56 +1,23 @@ import React from 'react'; -import { VStack, Heading, Text, Grid, GridItem } from '@chakra-ui/react'; -import { useTranslation } from 'react-i18next'; +import { Grid } from '@chakra-ui/react'; -export const LinksSection = () => { - const { t } = useTranslation(); - return ( - - - - - {t('footer.restoredFurniture.title')} - - {t('footer.restoredFurniture.entries')} - {t('footer.restoredFurniture.rates')} - {t('footer.restoredFurniture.categories')} - {t('footer.restoredFurniture.sale')} - - - - - - {t('footer.socialNetworks.title')} - - {t('footer.socialNetworks.instagram')} - {t('footer.socialNetworks.msn')} - - - - - - {t('footer.blackMarket.title')} - - {t('footer.blackMarket.ourHistory')} - {t('footer.blackMarket.staff')} - {t('footer.blackMarket.workWithUs')} - - - - - - {t('footer.support.title')} - - {t('footer.support.chat')} - {t('footer.support.address')} - - - - ); -}; +import { LinksColumn } from './LinksColumn'; + +export const LinksSection = () => ( + + + + + + +); diff --git a/src/components/Footer/NewsletterSection.tsx b/src/components/Footer/NewsletterSection.tsx index 2706ead..e686e98 100644 --- a/src/components/Footer/NewsletterSection.tsx +++ b/src/components/Footer/NewsletterSection.tsx @@ -14,7 +14,7 @@ export const NewsletterSection = () => { return ( {}}> - + {t('footer.newsletter.title')}