Skip to content

Commit

Permalink
Update Footer (#1092)
Browse files Browse the repository at this point in the history
* Migrate Footer styles

* Update footer links

* Remove unused translations from footer, fix footer links

* Add title abobe footer link groups

* Update footer links

* Fix footer links translations

* Fix translation typo

* Style footer titles

* Fix responsive styles for Footer
  • Loading branch information
ani-kalpachka authored and dimitur2204 committed Nov 21, 2022
1 parent 267d257 commit 810a26c
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 174 deletions.
19 changes: 12 additions & 7 deletions public/locales/bg/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,22 @@
"link": "Линк",
"components": {
"footer": {
"about-us": "За доброволците",
"donatе": "Дарете",
"about-us": "За нас",
"resources": "Ресурси",
"others": "Други",
"all-campaigns": "Всички кампании",
"suggest-campaign": "Предложете кампания",
"who-are-we": "Кои сме ние?",
"about-project": "За проекта",
"docs": "Документация",
"dev-docs": "Техническа Документация",
"support": "Станете доброволец",
"support-us": "Подкрепете ни",
"become-a-volunteer": "Станете доброволец",
"reports": "Отчети",
"contact": "Контакти",
"faq": "Често задавани въпроси",
"privacy-policy": "Защита на лични данни",
"terms-of-service": "Общи условия",
"hosting-partner": "Хостинг партньор:",
"copyrights": "Podkrepi.bg ©2022 Всички права запазени.",
"version": "Версия"
"copyrights": "Podkrepi.bg ©2022 Всички права запазени."
}
},
"or": "или",
Expand Down
25 changes: 15 additions & 10 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"nav": {
"home": "Home",
"about": {
"about-project": "The Project",
"about-project": "The project",
"about-us": "About us",
"who-are-we": "Who are we?",
"support_us": "Support us",
Expand All @@ -14,7 +14,7 @@
"index": "Campaigns",
"all-campaigns": "All campaigns",
"create": "Suggest a campaign",
"faq": "Frequently Asked Questions"
"faq": "Frequently asked questions"
},
"admin": {
"index": "Administration",
Expand Down Expand Up @@ -56,17 +56,22 @@
"support": "Donate",
"components": {
"footer": {
"donatе": "Donate",
"about-us": "About us",
"about-project": "The project",
"docs": "Documentation",
"dev-docs": "Technical Documentation",
"support": "Support us",
"resources": "Resources",
"others": "Others",
"all-campaigns": "All campaigns",
"who-are-we": "Who are we?",
"suggest-campaign": "Suggest a campaign",
"about-project": "About the project",
"support-us": "Support us",
"become-a-volunteer": "Become a volunteer",
"reports": "Reports",
"contact": "Contact",
"faq": "Frequently asked questions",
"privacy-policy": "Privacy Policy",
"terms-of-service": "Terms of service",
"hosting-partner": "Hosting partner:",
"copyrights": "Podkrepi.bg ©2022 All rights reserved.",
"version": "Version"
"terms-of-service": "Terms of Service",
"copyrights": "Podkrepi.bg ©2022 All rights reserved."
}
},
"or": "or",
Expand Down
156 changes: 0 additions & 156 deletions src/components/layout/Footer.tsx

This file was deleted.

61 changes: 61 additions & 0 deletions src/components/layout/Footer/Footer.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { Container, Grid, lighten, Typography } from '@mui/material'
import { styled } from '@mui/system'

import theme from 'common/theme'

export const Root = styled(Container)(() => ({
display: 'flex',
justifyContent: 'center',
textAlign: 'left',
backgroundColor: theme.palette.primary.dark,
color: lighten(theme.palette.primary.main, 0.75),

'& a': {
color: lighten(theme.palette.primary.main, 0.75),

'&:hover': {
color: lighten(theme.palette.primary.main, 0.55),
},
},
}))

export const FooterWrapper = styled(Grid)(() => ({
margin: theme.spacing(5),
}))

export const FooterLinksWrapper = styled(Grid)(() => ({
margin: theme.spacing(6, 0, 3, 0),

[theme.breakpoints.up('sm')]: {
marginTop: 0,
},

[theme.breakpoints.up('md')]: {
display: 'inline-flex',
gap: theme.spacing(1),
},
}))

export const FooterLinkTitle = styled(Typography)(() => ({
fontWeight: 600,
fontSize: theme.typography.pxToRem(16),
marginBottom: theme.spacing(1),
paddingBottom: theme.spacing(0.5),
width: 'fit-content',
borderBottom: `2px solid ${lighten(theme.palette.primary.main, 0.4)}`,
}))

export const FooterLink = styled(Grid)(() => ({
padding: theme.spacing(0.5, 0),
}))

export const Copyright = styled(Grid)(() => ({
borderTop: `2px solid ${lighten(theme.palette.primary.main, 0.4)}`,
paddingTop: theme.spacing(3),
}))

export const SocialIconsWrapper = styled(Grid)(() => ({
display: 'flex',
gap: theme.spacing(1),
marginTop: theme.spacing(2),
}))
22 changes: 22 additions & 0 deletions src/components/layout/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useTranslation } from 'next-i18next'

import { LogoSocialIcons } from './LogoSocialIcons'
import { FooterLinks } from './FooterLinks'

import { Copyright, FooterWrapper, Root } from './Footer.styled'

export default function Footer() {
const { t } = useTranslation()

return (
<Root maxWidth={false} disableGutters>
<FooterWrapper container maxWidth="xl">
<LogoSocialIcons />
<FooterLinks />
<Copyright item xs={12}>
{t('components.footer.copyrights')}
</Copyright>
</FooterWrapper>
</Root>
)
}
34 changes: 34 additions & 0 deletions src/components/layout/Footer/FooterLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useTranslation } from 'next-i18next'
import Link from 'next/link'

import { Grid } from '@mui/material'

import ExternalLink from 'components/common/ExternalLink'
import { footerLinks } from './helpers/FooterData'

import { FooterLink, FooterLinksWrapper, FooterLinkTitle } from './Footer.styled'

export const FooterLinks = () => {
const { t } = useTranslation()

return (
<FooterLinksWrapper item xs={12} sm={4} md={7}>
{footerLinks.map((data, index) => (
<Grid container key={index} item xs={12} md={3} direction="column" mb={3}>
<FooterLinkTitle>{t(data.title)}</FooterLinkTitle>
{data.links.map(({ label, href, external }, linkIndex) => (
<FooterLink key={linkIndex}>
{external ? (
<ExternalLink href={href}>{t(label)}</ExternalLink>
) : (
<Link href={href}>
<a>{t(label)}</a>
</Link>
)}
</FooterLink>
))}
</Grid>
))}
</FooterLinksWrapper>
)
}
25 changes: 25 additions & 0 deletions src/components/layout/Footer/LogoSocialIcons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Link from 'next/link'
import { useRouter } from 'next/router'

import { Grid } from '@mui/material'

import { routes } from 'common/routes'
import PodkrepiLogo from 'components/brand/PodkrepiLogo'
import { SocialIcons } from './SocialIcons'

export const LogoSocialIcons = () => {
const { locale } = useRouter()

return (
<Grid item xs={12} sm={8} md={5} container direction="column">
<Grid item>
<Link href={routes.index}>
<a>
<PodkrepiLogo locale={locale} size="large" variant="fixed" />
</a>
</Link>
</Grid>
<SocialIcons />
</Grid>
)
}
Loading

0 comments on commit 810a26c

Please sign in to comment.