diff --git a/.eslintrc.json b/.eslintrc.json
index bffb357..09937b6 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,3 +1,6 @@
{
- "extends": "next/core-web-vitals"
+ "extends": "next/core-web-vitals",
+ "rules": {
+ "react-hooks/exhaustive-deps": "off"
+ }
}
diff --git a/README.md b/README.md
index 71e0956..ffc92a9 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,3 @@
-# LinkWarden
-
-## A place for your useful links.
+# Linkwarden
Rebuilding things from ground up...
diff --git a/components/ClickAwayHandler.tsx b/components/ClickAwayHandler.tsx
index d577e2f..88ff23b 100644
--- a/components/ClickAwayHandler.tsx
+++ b/components/ClickAwayHandler.tsx
@@ -26,7 +26,11 @@ function useOutsideAlerter(
}, [ref, onClickOutside]);
}
-export default function ({ children, onClickOutside, className }: Props) {
+export default function ClickAwayHandler({
+ children,
+ onClickOutside,
+ className,
+}: Props) {
const wrapperRef = useRef(null);
useOutsideAlerter(wrapperRef, onClickOutside);
diff --git a/components/CollectionCard.tsx b/components/CollectionCard.tsx
index 9abd8a2..fed3b1f 100644
--- a/components/CollectionCard.tsx
+++ b/components/CollectionCard.tsx
@@ -6,12 +6,10 @@ import useLinkStore from "@/store/links";
import Dropdown from "./Dropdown";
import { useState } from "react";
import Modal from "@/components/Modal";
-import CollectionInfo from "@/components/Modal/Collection/CollectionInfo";
-import DeleteCollection from "@/components/Modal/Collection/DeleteCollection";
+import CollectionModal from "@/components/Modal/Collection";
import ProfilePhoto from "./ProfilePhoto";
-import TeamManagement from "./Modal/Collection/TeamManagement";
-export default function ({
+export default function CollectionCard({
collection,
}: {
collection: CollectionIncludingMembers;
@@ -126,7 +124,7 @@ export default function ({
) : null}
{editCollectionModal ? (
{formattedDate}
- +{url.host}
{formattedDate}
- +{url.host}
Loading...
diff --git a/components/Modal/ChangePassword.tsx b/components/Modal/ChangePassword.tsx deleted file mode 100644 index 89635e1..0000000 --- a/components/Modal/ChangePassword.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import React, { useState } from "react"; -import { AccountSettings } from "@/types/global"; - -type Props = { - togglePasswordFormModal: Function; - user: AccountSettings; - setPasswordForm: Function; -}; - -export default function ChangePassword({ - togglePasswordFormModal, - user, - setPasswordForm, -}: Props) { - const [oldPassword, setOldPassword] = useState(""); - const [newPassword1, setNewPassword1] = useState(""); - const [newPassword2, setNewPassword2] = useState(""); - - const submit = async () => { - if (oldPassword !== "" && newPassword1 !== "" && newPassword2 !== "") { - if (newPassword1 === newPassword2) { - setPasswordForm(oldPassword, newPassword1); - togglePasswordFormModal(); - } else { - console.log("Passwords do not match."); - } - } else { - console.log("Please fill out all the fields."); - } - }; - - return ( -Change Password
- -Old Password
- - setOldPassword(e.target.value)} - type="text" - className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" - /> -New Password
- - setNewPassword1(e.target.value)} - type="text" - className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" - /> -Re-enter New Password
- - setNewPassword2(e.target.value)} - type="text" - className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" - /> - -- {method === "CREATE" ? "Add" : "Edit"} Collection -
-diff --git a/components/Modal/Collection/DeleteCollection.tsx b/components/Modal/Collection/DeleteCollection.tsx index ef7c815..408bf1b 100644 --- a/components/Modal/Collection/DeleteCollection.tsx +++ b/components/Modal/Collection/DeleteCollection.tsx @@ -21,7 +21,7 @@ export default function DeleteCollection({ const router = useRouter(); const submit = async () => { - if (!collection.id) return null; + if (!collection.id || collection.name !== inputField) return null; const response = await removeCollection(collection.id); if (response) { @@ -31,23 +31,56 @@ export default function DeleteCollection({ }; return ( -
Delete Collection
+Warning!
-- To confirm, type " - {collection.name}" in - the box below: -
++ Please note that deleting the collection will permanently remove all + its contents, including the following: +
++ Please double-check that you have backed up any essential data and + have informed the relevant members about this action. +
++ To confirm, type " + {collection.name} + " in the box below: +
+ + setInputField(e.target.value)} + type="text" + placeholder={`Type "${collection.name}" Here.`} + className="w-72 sm:w-96 rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> +- Sharing & Collaboration -
-Make Public
(All Members have Read access to this collection.)
-+ {method === "CREATE" && "Add"} Collection{" "} + {method === "UPDATE" && "Settings"} +
+Old Password
+ + setOldPassword(e.target.value)} + type="password" + className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> +New Password
+ + setNewPassword1(e.target.value)} + type="password" + className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> +Re-enter New Password
+ + setNewPassword2(e.target.value)} + type="password" + className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> + +Profile Visibility
+ ++ This will limit who can find and add you to other Collections. +
+ + {user.isPrivate && ( +Whitelisted Users
++ Please provide the Email addresses of the users you wish to grant + visibility to your profile. Separated by comma. +
+Settings
- +Display Name
- setUser({ ...user, name: e.target.value })} - className="w-full rounded-md p-2 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" - /> -Password
- -- Password modified. Please click{" "} - "Apply Settings" to - apply the changes.. -
- ) : null} -- Profile Photo -
+Profile Photo
Display Name
+ setUser({ ...user, name: e.target.value })} + className="w-full rounded-md p-2 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> +Profile Visibility
- -- This will limit who can find and add you to other Collections. -
- - {user.isPrivate ? ( -Whitelisted Users
-- Please provide the Email addresses of the users you wish to grant - visibility to your profile. Separated by comma. -
-+ Account Settings +
+