fix: navbar & footer broken links

This commit is contained in:
Sonny
2024-11-15 18:53:28 +01:00
parent 6005374340
commit 2de2556a20
2 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
import PATHS from '#core/constants/paths'; import PATHS from '#core/constants/paths';
import { Link } from '@inertiajs/react';
import { route } from '@izzyjs/route/client'; import { route } from '@izzyjs/route/client';
import { Anchor, Group, Text } from '@mantine/core'; import { Anchor, Group, Text } from '@mantine/core';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@@ -21,7 +20,7 @@ export function MantineFooter() {
const items = links.map((link) => ( const items = links.map((link) => (
<Anchor <Anchor
c="dimmed" c="dimmed"
component={Link} component={ExternalLink}
key={link.label} key={link.label}
href={link.link} href={link.link}
size="sm" size="sm"

View File

@@ -17,7 +17,6 @@ import { useTranslation } from 'react-i18next';
import ExternalLink from '~/components/common/external_link'; import ExternalLink from '~/components/common/external_link';
import { MantineLanguageSwitcher } from '~/components/common/language_switcher'; import { MantineLanguageSwitcher } from '~/components/common/language_switcher';
import { MantineThemeSwitcher } from '~/components/common/theme_switcher'; import { MantineThemeSwitcher } from '~/components/common/theme_switcher';
import { MantineUserCard } from '~/components/common/user_card';
import useUser from '~/hooks/use_user'; import useUser from '~/hooks/use_user';
import classes from './mobile.module.css'; import classes from './mobile.module.css';
@@ -31,7 +30,9 @@ export default function Navbar() {
<Box pb={40}> <Box pb={40}>
<header className={classes.header}> <header className={classes.header}>
<Group justify="space-between" h="100%"> <Group justify="space-between" h="100%">
<Image src="/logo-light.png" h={35} alt="MyLinks's logo" /> <Link href="/">
<Image src="/logo-light.png" h={35} alt="MyLinks's logo" />
</Link>
<Group h="100%" gap={0} visibleFrom="sm"> <Group h="100%" gap={0} visibleFrom="sm">
<Link href="/" className={classes.link}> <Link href="/" className={classes.link}>
@@ -102,11 +103,13 @@ export default function Navbar() {
<Group justify="center" grow pb="xl" px="md"> <Group justify="center" grow pb="xl" px="md">
{!isAuthenticated ? ( {!isAuthenticated ? (
<Button component="a" href={route('auth').path}> <Button component="a" href={route('auth').path} w={110}>
{t('login')} {t('login')}
</Button> </Button>
) : ( ) : (
<MantineUserCard /> <Button component={Link} href={route('dashboard').path} w={110}>
Dashboard
</Button>
)} )}
</Group> </Group>
</ScrollArea> </ScrollArea>