Compare commits
No commits in common. "3ef29e246eebacdb90336608bd36d600cfea36cc" and "10a69d261f209972ef98a3206fa0572c27e5a83d" have entirely different histories.
3ef29e246e
...
10a69d261f
@ -4,10 +4,9 @@ import { motion } from "framer-motion"
|
|||||||
import { SideMenu } from "@/components/pages/dashboard/SideMenu"
|
import { SideMenu } from "@/components/pages/dashboard/SideMenu"
|
||||||
import { Switch } from "@/components/ui/switch"
|
import { Switch } from "@/components/ui/switch"
|
||||||
import { Label } from "@/components/ui/label"
|
import { Label } from "@/components/ui/label"
|
||||||
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"
|
import { Card } from "@/components/ui/card"
|
||||||
import { ChangePassword } from "@/components/cards/dashboard/Settings/ChangePassword"
|
import { ChangePassword } from "@/components/cards/dashboard/Settings/ChangePassword"
|
||||||
import { useState, useEffect } from "react"
|
import { useState, useEffect } from "react";
|
||||||
import { LayoutDashboard } from "lucide-react"
|
|
||||||
|
|
||||||
const fadeIn = {
|
const fadeIn = {
|
||||||
initial: { opacity: 0, y: 20 },
|
initial: { opacity: 0, y: 20 },
|
||||||
@ -27,7 +26,7 @@ export default function Settings() {
|
|||||||
const fetchSettings = async () => {
|
const fetchSettings = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const response = await feth2ch('/api/users/settings');
|
const response = await fetch('/api/users/settings');
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setSettings(data);
|
setSettings(data);
|
||||||
@ -41,7 +40,7 @@ export default function Settings() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fetchSettings()
|
fetchSettings();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const updateSetting = async (settingName: string, value: boolean) => {
|
const updateSetting = async (settingName: string, value: boolean) => {
|
||||||
@ -94,17 +93,8 @@ export default function Settings() {
|
|||||||
<h1 className="text-3xl font-bold mb-6 text-foreground">Settings</h1>
|
<h1 className="text-3xl font-bold mb-6 text-foreground">Settings</h1>
|
||||||
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
||||||
<ChangePassword />
|
<ChangePassword />
|
||||||
<Card>
|
<Card className="p-6">
|
||||||
<CardHeader>
|
<h2 className="text-xl font-semibold mb-4">UI Settings</h2>
|
||||||
<CardTitle className="flex items-center">
|
|
||||||
<LayoutDashboard size={15} className="mr-1" />
|
|
||||||
UI Settings
|
|
||||||
</CardTitle>
|
|
||||||
<CardDescription>
|
|
||||||
Modify your user experience here
|
|
||||||
</CardDescription>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<Label htmlFor="hide-ai">Hide Generative AI</Label>
|
<Label htmlFor="hide-ai">Hide Generative AI</Label>
|
||||||
@ -115,6 +105,7 @@ export default function Settings() {
|
|||||||
onCheckedChange={(checked) => updateSetting('hideGenAI', checked)}
|
onCheckedChange={(checked) => updateSetting('hideGenAI', checked)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<Label htmlFor="hide-upgrades">Hide all upgrades/roles</Label>
|
<Label htmlFor="hide-upgrades">Hide all upgrades/roles</Label>
|
||||||
<Switch
|
<Switch
|
||||||
@ -124,6 +115,7 @@ export default function Settings() {
|
|||||||
onCheckedChange={(checked) => updateSetting('hideUpgrades', checked)}
|
onCheckedChange={(checked) => updateSetting('hideUpgrades', checked)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<Label htmlFor="hide-crypto">Hide crypto exchange</Label>
|
<Label htmlFor="hide-crypto">Hide crypto exchange</Label>
|
||||||
<Switch
|
<Switch
|
||||||
@ -134,7 +126,6 @@ export default function Settings() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
@ -46,7 +46,7 @@ export function ChangePassword() {
|
|||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle className="flex items-center"><Mail size={15} className="mr-1" /> Change Email Password</CardTitle>
|
<CardTitle className="flex items-center"><Mail size={18} className="mr-1" /> Change Email Password</CardTitle>
|
||||||
<CardDescription>Please note, this will <b>NOT</b> change your Authentik password.</CardDescription>
|
<CardDescription>Please note, this will <b>NOT</b> change your Authentik password.</CardDescription>
|
||||||
{/* TODO: please tell me you added password resets to authentik by now */}
|
{/* TODO: please tell me you added password resets to authentik by now */}
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
@ -59,7 +59,6 @@ export function ChangePassword() {
|
|||||||
type="password"
|
type="password"
|
||||||
value={newPassword}
|
value={newPassword}
|
||||||
onChange={(e) => setNewPassword(e.target.value)}
|
onChange={(e) => setNewPassword(e.target.value)}
|
||||||
className="mt-1.5"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Button type="submit" disabled={loading}>
|
<Button type="submit" disabled={loading}>
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import React from "react"
|
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||||
|
|
||||||
interface FeatureCardProps {
|
interface FeatureCardProps {
|
||||||
|
@ -8,4 +8,3 @@ exclude:
|
|||||||
- name: All
|
- name: All
|
||||||
paths:
|
paths:
|
||||||
- .github/workflows/bump.yml
|
- .github/workflows/bump.yml
|
||||||
- components/ui
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user