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