diff --git a/pages/settings/appearance.tsx b/pages/settings/appearance.tsx
index 2ddde66..32d7473 100644
--- a/pages/settings/appearance.tsx
+++ b/pages/settings/appearance.tsx
@@ -2,37 +2,119 @@ import SettingsLayout from "@/layouts/SettingsLayout";
import { useTheme } from "next-themes";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faSun, faMoon } from "@fortawesome/free-solid-svg-icons";
+import { useState, useEffect } from "react";
+import { faClose } from "@fortawesome/free-solid-svg-icons";
+import useAccountStore from "@/store/account";
+import { AccountSettings } from "@/types/global";
+import { toast } from "react-hot-toast";
+import TextInput from "@/components/TextInput";
+import { resizeImage } from "@/lib/client/resizeImage";
+import ProfilePhoto from "@/components/ProfilePhoto";
+import SubmitButton from "@/components/SubmitButton";
+import React from "react";
+import Checkbox from "@/components/Checkbox";
export default function Appearance() {
const { theme, setTheme } = useTheme();
+ const submit = async () => {
+ setSubmitLoader(true);
+
+ const load = toast.loading("Applying...");
+
+ const response = await updateAccount({
+ ...user,
+ });
+
+ toast.dismiss(load);
+
+ if (response.ok) {
+ toast.success("Settings Applied!");
+ } else toast.error(response.data as string);
+ setSubmitLoader(false);
+ };
+
+ const [submitLoader, setSubmitLoader] = useState(false);
+
+ const { account, updateAccount } = useAccountStore();
+
+ const [user, setUser] = useState
(
+ !objectIsEmpty(account)
+ ? account
+ : ({
+ // @ts-ignore
+ id: null,
+ name: "",
+ username: "",
+ email: "",
+ emailVerified: null,
+ blurredFavicons: null,
+ image: "",
+ isPrivate: true,
+ // @ts-ignore
+ createdAt: null,
+ whitelistedUsers: [],
+ } as unknown as AccountSettings)
+ );
+
+ function objectIsEmpty(obj: object) {
+ return Object.keys(obj).length === 0;
+ }
+
+ useEffect(() => {
+ if (!objectIsEmpty(account)) setUser({ ...account });
+ }, [account]);
+
return (
- Select Theme
-
-
setTheme("dark")}
- >
-
-
Dark Theme
+
+
+
Select Theme
+
+
setTheme("dark")}
+ >
+
+
Dark Theme
- {/*
*/}
+ {/*
*/}
+
+
setTheme("light")}
+ >
+
+
Light Theme
+ {/*
*/}
+
+
-
setTheme("light")}
- >
-
-
Light Theme
- {/*
*/}
+
+
+
+ setUser({ ...user, blurredFavicons: !user.blurredFavicons })
+ }
+ />
+
+
);
diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx
index 953d1ee..75c0fd8 100644
--- a/pages/settings/billing.tsx
+++ b/pages/settings/billing.tsx
@@ -11,7 +11,7 @@ export default function Billing() {
return (
-
+
To manage/cancel your subsciption, visit the{" "}