mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
fix: navbar dashboard link
This commit is contained in:
@@ -40,7 +40,7 @@ export function FloatingNavbar({ width }: FloatingNavbarProps) {
|
||||
|
||||
const links = (
|
||||
<>
|
||||
<InternalLink href="/dashboard" style={{ fontSize: rem(16) }}>
|
||||
<InternalLink route="dashboard" style={{ fontSize: rem(16) }}>
|
||||
Dashboard
|
||||
</InternalLink>
|
||||
<ExternalLinkUnstyled
|
||||
|
||||
@@ -3,7 +3,7 @@ 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_auth';
|
||||
import { useAuth } from '~/hooks/use_auth';
|
||||
|
||||
interface UserButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
||||
image: string;
|
||||
@@ -45,9 +45,9 @@ const UserButton = forwardRef<HTMLButtonElement, UserButtonProps>(
|
||||
)
|
||||
);
|
||||
|
||||
export function MantineUserCard() {
|
||||
export function UserCard() {
|
||||
const { t } = useTranslation('common');
|
||||
const { user, isAuthenticated } = useUser();
|
||||
const { user, isAuthenticated } = useAuth();
|
||||
return (
|
||||
isAuthenticated && (
|
||||
<Menu withArrow>
|
||||
|
||||
@@ -17,10 +17,10 @@ import { AiOutlineFolderAdd } from 'react-icons/ai';
|
||||
import { IoIosSearch } from 'react-icons/io';
|
||||
import { IoAdd, IoShieldHalfSharp } from 'react-icons/io5';
|
||||
import { PiGearLight } from 'react-icons/pi';
|
||||
import { MantineUserCard } from '~/components/common/user_card';
|
||||
import { UserCard } from '~/components/common/user_card';
|
||||
import { FavoriteList } from '~/components/dashboard/favorite/favorite_list';
|
||||
import { SearchSpotlight } from '~/components/search/search';
|
||||
import useUser from '~/hooks/use_auth';
|
||||
import { useAuth } from '~/hooks/use_auth';
|
||||
import useShortcut from '~/hooks/use_shortcut';
|
||||
import { appendCollectionId } from '~/lib/navigation';
|
||||
import { useActiveCollection } from '~/stores/collection_store';
|
||||
@@ -32,7 +32,7 @@ interface DashboardNavbarProps {
|
||||
}
|
||||
export function DashboardNavbar({ isOpen, toggle }: DashboardNavbarProps) {
|
||||
const { t } = useTranslation('common');
|
||||
const { isAuthenticated, user } = useUser();
|
||||
const { isAuthenticated, user } = useAuth();
|
||||
|
||||
const { activeCollection } = useActiveCollection();
|
||||
const { globalHotkeysEnabled, setGlobalHotkeysEnabled } =
|
||||
@@ -84,7 +84,7 @@ export function DashboardNavbar({ isOpen, toggle }: DashboardNavbarProps) {
|
||||
<Burger opened={isOpen} onClick={toggle} size="sm" />
|
||||
<Text>Navigation</Text>
|
||||
</Group>
|
||||
<MantineUserCard />
|
||||
<UserCard />
|
||||
<Divider mt="xs" mb="md" />
|
||||
{isAuthenticated && user.isAdmin && (
|
||||
<NavLink
|
||||
|
||||
Reference in New Issue
Block a user