mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 15:05:35 +00:00
feat: add user dropdown in navbar
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user