Skip to content

Commit

Permalink
fix(footer): 📱 Responsive Footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudelsuppe42 committed Jan 14, 2024
1 parent c9ef186 commit f3ed108
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
39 changes: 27 additions & 12 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,37 @@ export default function Footer({ links, style }: FooterSimpleProps) {
return (
<div className={classes.footer} style={style}>
<Container className={classes.inner} size="xl">
<Anchor<'a'> style={{ fontSize: '14px' }} c="dimmed" variant="text">
<Anchor<'a'>
style={{ fontSize: '14px' }}
c="dimmed"
variant="text"
className={classes.copyright1}
>
{t('copyright', { year: new Date().getFullYear() })}
</Anchor>
<Group className={classes.links}>
{items}
<ActionIcon
component={Link}
href="https://discord.gg/buildtheearth"
variant="transparent"
aria-label="Discord"
target="_blank"
>
<Discord />
</ActionIcon>
<LanguageSwitcher />
<Group justify="center" className={classes.links}>
{items}
<ActionIcon
component={Link}
href="https://discord.gg/buildtheearth"
variant="transparent"
aria-label="Discord"
target="_blank"
>
<Discord />
</ActionIcon>
</Group>
<LanguageSwitcher className={classes.language} />
</Group>
<Anchor<'a'>
style={{ fontSize: '14px' }}
c="dimmed"
variant="text"
className={classes.copyright2}
>
{t('copyright', { year: new Date().getFullYear() })}
</Anchor>
</Container>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/LanguageSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const languages = [
{ label: '中文', code: 'zh', flag: 'cn' },
];

export function LanguageSwitcher() {
export function LanguageSwitcher({ className }: { className?: string }) {
const [opened, setOpened] = useState(false);
const { t } = useTranslation();
const router = useRouter();
Expand Down Expand Up @@ -55,7 +55,7 @@ export function LanguageSwitcher() {
width="target"
>
<Menu.Target>
<UnstyledButton className={classes.control} data-opened={opened}>
<UnstyledButton className={`${classes.control} ${className}`} data-opened={opened}>
<Group gap="xs">
<span
className={`fi fi-${selected && selected.flag} fis`}
Expand Down
30 changes: 27 additions & 3 deletions src/styles/components/Footer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,39 @@
padding-top: var(--mantine-spacing-sm);
padding-bottom: var(--mantine-spacing-sm);

@media (max-width: $mantine-breakpoint-xs) {
@media (max-width: $mantine-breakpoint-md) {
flex-direction: column;
}
}

.links {
width: fit-content;

@media (max-width: $mantine-breakpoint-xs) {
margin-top: var(--mantine-spacing-md);
@media (max-width: $mantine-breakpoint-md) {
margin: 0 auto;
width:100%

}
}

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

.copyright1 {
@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 f3ed108

Please sign in to comment.