diff --git a/hosting/src/app/(protected)/content/[documentTypeId]/[documentId]/page.tsx b/hosting/src/app/(protected)/content/[documentTypeId]/[documentId]/page.tsx index e838aa60..0254349a 100644 --- a/hosting/src/app/(protected)/content/[documentTypeId]/[documentId]/page.tsx +++ b/hosting/src/app/(protected)/content/[documentTypeId]/[documentId]/page.tsx @@ -87,7 +87,7 @@ const DocumentDetailsPage = () => { case "file-upload": return ; case "switcher": - return ; + return ; case "radio": return ; case "checkbox": diff --git a/hosting/src/app/(protected)/dashboard/page.tsx b/hosting/src/app/(protected)/dashboard/page.tsx index 3eab2ee2..644aac8a 100644 --- a/hosting/src/app/(protected)/dashboard/page.tsx +++ b/hosting/src/app/(protected)/dashboard/page.tsx @@ -56,7 +56,7 @@ export default function DashboardPage() { case "file-upload": return ; case "switcher": - return ; + return ; case "radio": return ; case "checkbox": diff --git a/hosting/src/app/(protected)/settings/page.tsx b/hosting/src/app/(protected)/settings/page.tsx index 3344ad42..20d4e1f1 100644 --- a/hosting/src/app/(protected)/settings/page.tsx +++ b/hosting/src/app/(protected)/settings/page.tsx @@ -24,13 +24,70 @@ export default function Settings() {
-
-
-
-

Personal Information

+
+
+
+
+

System

+
+
+
+ +
+ +
+
+
-
-
+
+ + +
+
+

Personal Information

+
+
+
+
+
+
+ User +
+
+ Edit your photo + + + + +
+
+ +
+ +
+ +

+ Click to upload or drag and drop +

+

SVG, PNG, JPG or GIF

+

(max, 800 X 800px)

+
+
+
+
+
- -
-
-
- -
-
-
-

Your Photo

-
-
-
-
-
- User -
-
- Edit your photo - - - - -
-
- -
- -
- -

- Click to upload or drag and drop -

-

SVG, PNG, JPG or GIF

-

(max, 800 X 800px)

-
-
- -
- - -
-
-
-
-
- -
-
-
-

System

-
-
-
- -
- -
-
+
diff --git a/hosting/src/components/DarkModeSwitcher.tsx b/hosting/src/components/DarkModeSwitcher.tsx index 4204218e..5e139f25 100644 --- a/hosting/src/components/DarkModeSwitcher.tsx +++ b/hosting/src/components/DarkModeSwitcher.tsx @@ -18,7 +18,7 @@ const DarkModeSwitcher = () => { return ( await saveColorMode(checked ? "dark" : "light")} onIcon="i-ri-moon-clear-fill text-white" offIcon="i-ri-sun-line" diff --git a/hosting/src/components/Form/Switcher.tsx b/hosting/src/components/Form/Switcher.tsx index d01ee698..168924cc 100644 --- a/hosting/src/components/Form/Switcher.tsx +++ b/hosting/src/components/Form/Switcher.tsx @@ -1,10 +1,10 @@ "use client"; -import {useState} from "react"; import {clsx} from "clsx"; +import {useEffect, useState} from "react"; interface SwitcherProps { style?: "default" | "rounded"; - defaultChecked?: boolean; + initialValue?: boolean; disabled?: boolean; onIcon?: string; offIcon?: string; @@ -13,13 +13,17 @@ interface SwitcherProps { export function Switcher({ style = "default", - defaultChecked = false, + initialValue = false, disabled = false, onIcon, offIcon, onChange, }: SwitcherProps) { - const [enabled, setEnabled] = useState(defaultChecked); + const [enabled, setEnabled] = useState(false); + + useEffect(() => { + setEnabled(initialValue); + }, []); const handleToggle = () => { if (!disabled) { @@ -34,14 +38,16 @@ export function Switcher({ return ( <>
{onIcon && offIcon && (
{onIcon && offIcon && ( +