@@ -222,7 +220,7 @@ export default function Sidebar({ className }: { className?: string }) {
diff --git a/components/SubmitButton.tsx b/components/SubmitButton.tsx
index fbcd8b8..d33ce1f 100644
--- a/components/SubmitButton.tsx
+++ b/components/SubmitButton.tsx
@@ -21,17 +21,15 @@ export default function SubmitButton({
return (
);
}
diff --git a/pages/collections/[id].tsx b/pages/collections/[id].tsx
index af6b385..178003e 100644
--- a/pages/collections/[id].tsx
+++ b/pages/collections/[id].tsx
@@ -9,7 +9,6 @@ import { useEffect, useState } from "react";
import MainLayout from "@/layouts/MainLayout";
import ProfilePhoto from "@/components/ProfilePhoto";
import SortDropdown from "@/components/SortDropdown";
-import useModalStore from "@/store/modals";
import useLinks from "@/hooks/useLinks";
import usePermissions from "@/hooks/usePermissions";
import NoLinksFound from "@/components/NoLinksFound";
@@ -18,10 +17,9 @@ import useAccountStore from "@/store/account";
import getPublicUserData from "@/lib/client/getPublicUserData";
import EditCollectionModal from "@/components/Modals/EditCollectionModal";
import EditCollectionSharingModal from "@/components/Modals/EditCollectionSharingModal";
+import DeleteCollectionModal from "@/components/Modals/DeleteCollectionModal";
export default function Index() {
- const { setModal } = useModalStore();
-
const { settings } = useLocalSettingsStore();
const router = useRouter();
@@ -76,6 +74,7 @@ export default function Index() {
const [editCollectionModal, setEditCollectionModal] = useState(false);
const [editCollectionSharingModal, setEditCollectionSharingModal] =
useState(false);
+ const [deleteCollectionModal, setDeleteCollectionModal] = useState(false);
return (
@@ -206,15 +205,7 @@ export default function Index() {
tabIndex={0}
onClick={() => {
(document?.activeElement as HTMLElement)?.blur();
- activeCollection &&
- setModal({
- modal: "COLLECTION",
- state: true,
- method: "UPDATE",
- isOwner: permissions === true,
- active: activeCollection,
- defaultIndex: permissions === true ? 2 : 1,
- });
+ setDeleteCollectionModal(true);
}}
>
{permissions === true
@@ -254,6 +245,12 @@ export default function Index() {
modalId={"edit-collection-sharing-modal" + activeCollection.id}
activeCollection={activeCollection}
/>
+ setDeleteCollectionModal(false)}
+ modalId={"delete-collection-modal" + activeCollection.id}
+ activeCollection={activeCollection}
+ />
>
) : undefined}
diff --git a/pages/collections/index.tsx b/pages/collections/index.tsx
index 5199641..325a32e 100644
--- a/pages/collections/index.tsx
+++ b/pages/collections/index.tsx
@@ -9,7 +9,6 @@ import CollectionCard from "@/components/CollectionCard";
import { useState } from "react";
import MainLayout from "@/layouts/MainLayout";
import { useSession } from "next-auth/react";
-import useModalStore from "@/store/modals";
import SortDropdown from "@/components/SortDropdown";
import { Sort } from "@/types/global";
import useSort from "@/hooks/useSort";
@@ -23,8 +22,6 @@ export default function Collections() {
const { data } = useSession();
- const { setModal } = useModalStore();
-
useSort({ sortBy, setData: setSortedCollections, data: collections });
const [newCollectionModal, setNewCollectionModal] = useState(false);
@@ -68,11 +65,7 @@ export default function Collections() {
tabIndex={0}
onClick={() => {
(document?.activeElement as HTMLElement)?.blur();
- setModal({
- modal: "COLLECTION",
- state: true,
- method: "CREATE",
- });
+ setNewCollectionModal(true);
}}
>
New Collection
diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx
index 5450342..20e01f3 100644
--- a/pages/dashboard.tsx
+++ b/pages/dashboard.tsx
@@ -24,6 +24,7 @@ import useModalStore from "@/store/modals";
import { toast } from "react-hot-toast";
import { MigrationFormat, MigrationRequest } from "@/types/global";
import DashboardItem from "@/components/DashboardItem";
+import NewLinkModal from "@/components/Modals/NewLinkModal";
export default function Dashboard() {
const { collections } = useCollectionStore();
@@ -99,6 +100,8 @@ export default function Dashboard() {
}
};
+ const [newLinkModal, setNewLinkModal] = useState(false);
+
return (
@@ -187,11 +190,7 @@ export default function Dashboard() {
{
- setModal({
- modal: "LINK",
- state: true,
- method: "CREATE",
- });
+ setNewLinkModal(true);
}}
className="inline-flex gap-1 relative w-[11rem] items-center btn btn-accent text-white group"
>
@@ -200,24 +199,28 @@ export default function Dashboard() {
className="w-5 h-5 left-4 group-hover:ml-[4rem] absolute duration-100"
/>
- Create New Item
+ Create New Link
-
-
+
+
-
- Import Your Bookmarks
-
-
+
Import From
+
-
+
)}
@@ -288,7 +293,6 @@ export default function Dashboard() {
className={`grid overflow-hidden 2xl:grid-cols-3 xl:grid-cols-2 grid-cols-1 gap-5 w-full`}
>
{links
-
.filter((e) => e.pinnedBy && e.pinnedBy[0])
.map((e, i) => )
.slice(0, showLinks)}
@@ -311,6 +315,11 @@ export default function Dashboard() {
)}