feat: remove login page (temp)

This commit is contained in:
Sonny
2024-11-05 22:27:17 +01:00
committed by Sonny
parent 41f82a8070
commit db578dbe51
10 changed files with 17 additions and 122 deletions

View File

@@ -1,5 +1,7 @@
import { route } from '@izzyjs/route/client';
import { Avatar, Group, Menu, Text, UnstyledButton } from '@mantine/core';
import { forwardRef } from 'react';
import { useTranslation } from 'react-i18next';
import { TbChevronRight } from 'react-icons/tb';
import useUser from '~/hooks/use_user';
@@ -44,6 +46,7 @@ const UserButton = forwardRef<HTMLButtonElement, UserButtonProps>(
);
export function MantineUserCard() {
const { t } = useTranslation('common');
const { user, isAuthenticated } = useUser();
return (
isAuthenticated && (
@@ -56,7 +59,9 @@ export function MantineUserCard() {
/>
</Menu.Target>
<Menu.Dropdown>
<Menu.Item>Logout</Menu.Item>
<Menu.Item component="a" href={route('auth.logout').path}>
{t('logout')}
</Menu.Item>
</Menu.Dropdown>
</Menu>
)

View File

@@ -50,8 +50,8 @@ export default function MantineNavbar() {
<MantineLanguageSwitcher />
{!isAuthenticated ? (
<Button
component={Link}
href={route('auth.login').url}
component="a"
href={route('auth').path}
visibleFrom="sm"
w={110}
>
@@ -60,7 +60,7 @@ export default function MantineNavbar() {
) : (
<Button
component={Link}
href={route('dashboard').url}
href={route('dashboard').path}
visibleFrom="sm"
w={110}
>
@@ -102,7 +102,7 @@ export default function MantineNavbar() {
<Group justify="center" grow pb="xl" px="md">
{!isAuthenticated ? (
<Button component={Link} href={route('auth.login').url}>
<Button component="a" href={route('auth').path}>
{t('login')}
</Button>
) : (

View File

@@ -97,7 +97,7 @@ export default function Navbar() {
<ModalSettings openItem={DropdownItemButtonWithPadding} />
</li>
<li>
<Link href={route('auth.login').url}>{t('login')}</Link>
<Link href={route('auth').path}>{t('login')}</Link>
</li>
</>
)}