feat: add user dropdown in navbar

This commit is contained in:
Sonny
2024-05-14 13:11:10 +02:00
committed by Sonny
parent 243984ca66
commit c916b5870b
6 changed files with 47 additions and 34 deletions

View File

@@ -1,5 +1,4 @@
import PATHS from '#constants/paths';
import styled from '@emotion/styled';
import { BsThreeDotsVertical } from 'react-icons/bs';
import { HiOutlinePencil } from 'react-icons/hi2';
import { IoIosAddCircleOutline } from 'react-icons/io';
@@ -7,10 +6,6 @@ import { IoTrashOutline } from 'react-icons/io5';
import Dropdown from '~/components/common/dropdown/dropdown';
import { DropdownItemLink } from '~/components/common/dropdown/dropdown_item';
const DeleteItem = styled(DropdownItemLink)(({ theme }) => ({
color: theme.colors.lightRed,
}));
const CollectionControls = () => (
<Dropdown label={<BsThreeDotsVertical />}>
<DropdownItemLink href={PATHS.LINK.CREATE}>
@@ -19,9 +14,9 @@ const CollectionControls = () => (
<DropdownItemLink href={PATHS.COLLECTION.EDIT}>
<HiOutlinePencil /> Edit
</DropdownItemLink>
<DeleteItem href={PATHS.COLLECTION.REMOVE}>
<DropdownItemLink href={PATHS.COLLECTION.REMOVE} danger>
<IoTrashOutline /> Delete
</DeleteItem>
</DropdownItemLink>
</Dropdown>
);

View File

@@ -20,10 +20,6 @@ const StartItem = styled(DropdownItemButton)(({ theme }) => ({
color: theme.colors.yellow,
}));
const DeleteItem = styled(DropdownItemLink)(({ theme }) => ({
color: theme.colors.lightRed,
}));
export default function LinkControls({ link }: { link: Link }) {
const theme = useTheme();
const { collections, setCollections } = useCollections();
@@ -87,11 +83,12 @@ export default function LinkControls({ link }: { link: Link }) {
>
<HiOutlinePencil /> Edit
</DropdownItemLink>
<DeleteItem
<DropdownItemLink
href={appendCollectionId(PATHS.LINK.REMOVE, link.collectionId)}
danger
>
<IoTrashOutline /> Delete
</DeleteItem>
</DropdownItemLink>
</Dropdown>
);
}