mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
feat: add burger menu + add link btn
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { motion } from "framer-motion";
|
||||
import LinkTag from "next/link";
|
||||
|
||||
import { Category, Link } from "types";
|
||||
@@ -6,15 +7,21 @@ import EditItem from "components/QuickActions/EditItem";
|
||||
import RemoveItem from "components/QuickActions/RemoveItem";
|
||||
import LinkItem from "./LinkItem";
|
||||
|
||||
import { motion } from "framer-motion";
|
||||
import ButtonLink from "components/ButtonLink";
|
||||
import CreateItem from "components/QuickActions/CreateItem";
|
||||
import { RxHamburgerMenu } from "react-icons/rx";
|
||||
import styles from "./links.module.scss";
|
||||
|
||||
export default function Links({
|
||||
category,
|
||||
toggleFavorite,
|
||||
isMobile,
|
||||
openMobileModal,
|
||||
}: {
|
||||
category: Category;
|
||||
toggleFavorite: (linkId: Link["id"]) => void;
|
||||
isMobile: boolean;
|
||||
openMobileModal: () => void;
|
||||
}) {
|
||||
if (category === null) {
|
||||
return (
|
||||
@@ -29,13 +36,27 @@ export default function Links({
|
||||
return (
|
||||
<div className={styles["links-wrapper"]}>
|
||||
<h2 className={styles["category-header"]}>
|
||||
<span className={styles["category-name"]}>
|
||||
<span
|
||||
className={styles["category-name"]}
|
||||
style={{ display: "flex", alignItems: "center", gap: ".25em" }}
|
||||
>
|
||||
{isMobile && (
|
||||
<ButtonLink
|
||||
style={{
|
||||
display: "flex",
|
||||
}}
|
||||
onClick={openMobileModal}
|
||||
>
|
||||
<RxHamburgerMenu size={"1.5em"} style={{ marginRight: ".5em" }} />
|
||||
</ButtonLink>
|
||||
)}
|
||||
{name}
|
||||
{links.length > 0 && (
|
||||
<span className={styles["links-count"]}> — {links.length}</span>
|
||||
)}
|
||||
</span>
|
||||
<span className={styles["category-controls"]}>
|
||||
<CreateItem type="link" categoryId={category.id} />
|
||||
<EditItem type="category" id={id} />
|
||||
<RemoveItem type="category" id={id} />
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user