Skip to content

Commit

Permalink
feat(v2): 💄 Footer V2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Aug 11, 2024
1 parent d1199a4 commit e5d24e6
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 112 deletions.
Empty file removed src/components/v2/Footer.tsx
Empty file.
54 changes: 54 additions & 0 deletions src/components/v2/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { ActionIcon, Anchor, Box, Group, Text } from '@mantine/core';

import { LanguageSwitcher } from '@/components/LanguageSwitcher';
import classes from '@/styles/components/v2/Footer.module.css';
import { Discord } from '@icons-pack/react-simple-icons';
import Link from 'next/link';
import React from 'react';
import { useTranslation } from 'react-i18next';

interface FooterProps {
links: { link: string; translation: string }[];
style?: React.CSSProperties;
}

export default function Footer({ links, style }: FooterProps) {
const { t } = useTranslation();

const items = links.map((link) => (
<Anchor component={Link} c="dimmed" key={link.translation} href={link.link} size="sm">
{t(`links.${link.translation}`)}
</Anchor>
));

return (
<Box className={classes.root} style={style}>
<Box className={classes.container}>
<Text style={{ fontSize: '14px' }} c="dimmed" variant="text" className={classes.copyright}>
{t('copyright', { year: new Date().getFullYear() })}
</Text>
<Group className={classes.links}>
{items}
<ActionIcon
component={Link}
href="http://go.buildtheearth.net/dc"
variant="transparent"
aria-label="Discord"
target="_blank"
>
<Discord />
</ActionIcon>
<LanguageSwitcher className={classes.language} />
</Group>
<Anchor<'a'>
style={{ fontSize: '14px' }}
c="dimmed"
variant="text"
className={classes.copyright2}
>
{t('copyright', { year: new Date().getFullYear() })}
</Anchor>
</Box>
</Box>
);
}
121 changes: 9 additions & 112 deletions src/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Footer from '@/components/v2/footer';
import Header from '@/components/v2/header';
import { BackgroundImage } from '@mantine/core';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
Expand All @@ -24,120 +25,16 @@ const Home = () => {
width: '100%',
height: '100%',
}}
>
dw
</div>
></div>
</BackgroundImage>
dd1
<br />
dd2
<br />
dd3
<br />
dd4
<br />
dd5
<br />
dd6
<br />
dd7
<br />
dd8
<br />
dd9
<br />
dd1
<br />
dd2
<br />
dd3
<br />
dd4
<br />
dd5
<br />
dd6
<br />
dd7
<br />
dd8
<br />
dd9
<br />
dd1
<br />
dd2
<br />
dd3
<br />
dd4
<br />
dd5
<br />
dd6
<br />
dd7
<br />
dd8
<br />
dd9
<br />
dd1
<br />
dd2
<br />
dd3
<br />
dd4
<br />
dd5
<br />
dd6
<br />
dd7
<br />
dd8
<br />
dd9
<br />
dd1
<br />
dd2
<br />
dd3
<br />
dd4
<br />
dd5
<br />
dd6
<br />
dd7
<br />
dd8
<br />
dd9
<br />
dd1
<br />
dd2
<br />
dd3
<br />
dd4
<br />
dd5
<br />
dd6
<br />
dd7
<br />
dd8
<br />
dd9
<br />
<br />
</div>
<Footer
links={[
{ link: '/faq', translation: 'faq' },
{ link: '/contact', translation: 'contact' },
{ link: 'https://status.buildtheearth.net', translation: 'status' },
]}
/>
</>
);
};
Expand Down
50 changes: 50 additions & 0 deletions src/styles/components/v2/Footer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.root {
border-top: 1px solid light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-5));

width: 100vw;
}

.container {
display: flex;
align-items: center;
margin-left: calc(4 * var(--mantine-spacing-xl));
margin-right: calc(4 * var(--mantine-spacing-xl));
padding: var(--mantine-spacing-xs) 0px;
justify-content: space-between;
height: 100%;

@media (max-width: $mantine-breakpoint-md) {
margin-left: calc(var(--mantine-spacing-lg));
margin-right: calc(var(--mantine-spacing-lg));
flex-direction: column;
}
}

.links {

@media (max-width: $mantine-breakpoint-md) {
width: 100%;
}
}

.language {
@media (max-width: $mantine-breakpoint-md) {
width: 100%;
}
}

.copyright {
@media (max-width: $mantine-breakpoint-md) {
display: none;
}
}
.copyright2 {
display: none;
@media (max-width: $mantine-breakpoint-md) {
display: inherit;
margin-top: var(--mantine-spacing-sm);
width: 100%;
text-align: center;
font-size: x-small !important;
}
}

0 comments on commit e5d24e6

Please sign in to comment.