diff --git a/app/(protected)/_components/navbar.tsx b/app/(protected)/_components/navbar.tsx index e49ccaa..ac6f479 100644 --- a/app/(protected)/_components/navbar.tsx +++ b/app/(protected)/_components/navbar.tsx @@ -37,7 +37,7 @@ const Navbar = () => { asChild variant="secondary" size="sm" - className="w-full text-background hover:text-sky-400" + className="w-full text-sky-400 hover:text-background" > diff --git a/app/(protected)/settings/page.tsx b/app/(protected)/settings/page.tsx index 6715479..2f3c140 100644 --- a/app/(protected)/settings/page.tsx +++ b/app/(protected)/settings/page.tsx @@ -8,6 +8,8 @@ import { useSession } from "next-auth/react"; import { RiUserSettingsLine } from "react-icons/ri"; import { useCurrentUser } from "@/hooks/use-current-user"; +import { useIsClient } from "@/hooks/use-is-client"; +import Spinner from "@/components/spinner"; import { SettingsSchema } from "@/schemas"; import { settings } from "@/actions/settings"; import { Card, CardHeader, CardContent } from "@/components/ui/card"; @@ -45,6 +47,8 @@ export default function SettingsPage() { const [isPending, startTransition] = useTransition(); + const isClient = useIsClient(); + const form = useForm>({ resolver: zodResolver(SettingsSchema), defaultValues: { @@ -75,12 +79,15 @@ export default function SettingsPage() { } catch (error) { setError("Something went wrong!"); } finally { - form.reset(); - setError(""); - setSuccess(""); + // TODO: Check if needed + // form.reset(); + // setError(""); + // setSuccess(""); } }; + if (!isClient) return ; + return ( @@ -113,6 +120,7 @@ export default function SettingsPage() { )} /> + {user?.isOAuth === false && ( <> )} + )} /> + {user?.isOAuth === false && ( + )} /> diff --git a/components/client-only.tsx b/components/client-only.tsx index dcb9ee0..d2c9979 100644 --- a/components/client-only.tsx +++ b/components/client-only.tsx @@ -1,7 +1,8 @@ import { useIsClient } from "@/hooks/use-is-client"; +import Spinner from "./spinner"; export function ClientOnly({ children }: { children: React.ReactNode }) { const isClient = useIsClient(); - return isClient ? <>{children} : null; + return isClient ? <>{children} : ; }