Fixed settings stuff
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { useClientSettings } from "@/hooks/use-settings";
|
||||
import { setClientSettings } from "@/lib/clientSettings";
|
||||
import SettingSchema from "./SettingSchema";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
@@ -11,19 +10,20 @@ import {
|
||||
CLIENT_SCHEMA,
|
||||
ProfileSettings,
|
||||
} from "@/types/settings";
|
||||
import { useParams, useRouter, useSearchParams } from "next/navigation";
|
||||
import { useRouter } from "next/navigation";
|
||||
import axios from "axios";
|
||||
import { useClientSettings } from "@/hooks/use-settings";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Settings({
|
||||
tab,
|
||||
profileSettings,
|
||||
setProfileSettings,
|
||||
profileSettings: ps,
|
||||
}: {
|
||||
tab?: string;
|
||||
profileSettings: ProfileSettings;
|
||||
setProfileSettings: React.Dispatch<React.SetStateAction<ProfileSettings>>;
|
||||
}) {
|
||||
const [settings, setSettings] = useClientSettings();
|
||||
const [profileSettings, setProfileSettings] = useState<ProfileSettings>(ps);
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Button } from "../ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
@@ -11,18 +10,17 @@ import {
|
||||
import { cn } from "@/lib/utils";
|
||||
import Settings from "./Settings";
|
||||
import { ProfileSettings } from "@/types/settings";
|
||||
import { useProfileSettings } from "@/hooks/use-settings";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function SettingsDialog({
|
||||
className,
|
||||
tab,
|
||||
profile,
|
||||
}: {
|
||||
className?: string;
|
||||
tab?: string;
|
||||
profile?: ProfileSettings;
|
||||
profile: ProfileSettings;
|
||||
}) {
|
||||
const [profileSettings, setProfileSettings] = useProfileSettings();
|
||||
|
||||
return (
|
||||
<Dialog>
|
||||
<DialogTrigger asChild>
|
||||
@@ -41,11 +39,7 @@ export default function SettingsDialog({
|
||||
</DialogHeader>
|
||||
|
||||
<div className="w-full">
|
||||
<Settings
|
||||
tab={tab}
|
||||
profileSettings={profileSettings}
|
||||
setProfileSettings={setProfileSettings}
|
||||
/>
|
||||
<Settings tab={tab} profileSettings={profile} />
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user