From a5d0d08c9356410cd502310468a4662333abe37d Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 18 May 2023 21:32:05 +0330 Subject: [PATCH] added settings modal UI --- components/Modal/UserSettings.tsx | 139 +++++++++++++++++++++++++----- 1 file changed, 116 insertions(+), 23 deletions(-) diff --git a/components/Modal/UserSettings.tsx b/components/Modal/UserSettings.tsx index b61055b..4dfe16f 100644 --- a/components/Modal/UserSettings.tsx +++ b/components/Modal/UserSettings.tsx @@ -5,49 +5,142 @@ import { useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faPlus } from "@fortawesome/free-solid-svg-icons"; -import { NewLink } from "@/types/global"; -import useLinkStore from "@/store/links"; -import RequiredBadge from "../RequiredBadge"; +import { faCircleUser, faClose } from "@fortawesome/free-solid-svg-icons"; +import Checkbox from "../Checkbox"; +import useAccountStore from "@/store/account"; type Props = { toggleSettingsModal: Function; }; export default function UserSettings({ toggleSettingsModal }: Props) { - const [newLink, setNewLink] = useState(); + const { account } = useAccountStore(); + const [collectionProtection, setCollectionProtection] = useState(false); - const { addLink } = useLinkStore(); + const [name, setName] = useState(account.name); + const [email, setEmail] = useState(account.email); + const [selectedFile, setSelectedFile] = useState(null); + + const handleFileChange = async (e) => { + const file = e.target.files[0]; + setSelectedFile(file); + }; const submit = async () => { - console.log(newLink); - - const response = await addLink(newLink as NewLink); - - if (response) toggleSettingsModal(); + // const response = await addLink(newLink as NewLink); + // if (response) toggleSettingsModal(); }; return (
-

Settings

+

Settings

-
-

- Name - -

- +

Profile Settings

+ +
+
+
+

Display Name

+ setName(e.target.value)} + className="w-full rounded-md p-2 border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" + /> +
+ +
+

Email

+ setEmail(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

+ +
+
+ Change Password +
+
+
+
+ +
+

+ Profile Photo +

+
+ {/* Image goes here */} + +
+ +
+
+ +
+
+
+
+ +
+ +

Data Settings

+ +
+
+ Export Data +
+
+ +
+ +

Privacy Settings

+ + setCollectionProtection(!collectionProtection)} + /> + +
+
+ Manage Allowed Users +
- Apply Settings