mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
feat: remove login page (temp)
This commit is contained in:
@@ -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>
|
||||
)
|
||||
|
||||
@@ -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>
|
||||
) : (
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user