Compare commits

..

No commits in common. "3ef29e246eebacdb90336608bd36d600cfea36cc" and "10a69d261f209972ef98a3206fa0572c27e5a83d" have entirely different histories.

4 changed files with 37 additions and 49 deletions

View File

@ -4,10 +4,9 @@ import { motion } from "framer-motion"
import { SideMenu } from "@/components/pages/dashboard/SideMenu"
import { Switch } from "@/components/ui/switch"
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 { useState, useEffect } from "react"
import { LayoutDashboard } from "lucide-react"
import { useState, useEffect } from "react";
const fadeIn = {
initial: { opacity: 0, y: 20 },
@ -27,7 +26,7 @@ export default function Settings() {
const fetchSettings = async () => {
try {
setLoading(true);
const response = await feth2ch('/api/users/settings');
const response = await fetch('/api/users/settings');
if (response.ok) {
const data = await response.json();
setSettings(data);
@ -41,7 +40,7 @@ export default function Settings() {
}
};
fetchSettings()
fetchSettings();
}, []);
const updateSetting = async (settingName: string, value: boolean) => {
@ -94,47 +93,39 @@ export default function Settings() {
<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">
<ChangePassword />
<Card>
<CardHeader>
<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="flex items-center justify-between">
<Label htmlFor="hide-ai">Hide Generative AI</Label>
<Switch
id="hide-ai"
checked={settings.hideGenAI}
disabled={loading}
onCheckedChange={(checked) => updateSetting('hideGenAI', checked)}
/>
</div>
<div className="flex items-center justify-between">
<Label htmlFor="hide-upgrades">Hide all upgrades/roles</Label>
<Switch
id="hide-upgrades"
checked={settings.hideUpgrades}
disabled={loading}
onCheckedChange={(checked) => updateSetting('hideUpgrades', checked)}
/>
</div>
<div className="flex items-center justify-between">
<Label htmlFor="hide-crypto">Hide crypto exchange</Label>
<Switch
id="hide-crypto"
checked={settings.hideCrypto}
disabled={loading}
onCheckedChange={(checked) => updateSetting('hideCrypto', checked)}
/>
</div>
<Card className="p-6">
<h2 className="text-xl font-semibold mb-4">UI Settings</h2>
<div className="space-y-4">
<div className="flex items-center justify-between">
<Label htmlFor="hide-ai">Hide Generative AI</Label>
<Switch
id="hide-ai"
checked={settings.hideGenAI}
disabled={loading}
onCheckedChange={(checked) => updateSetting('hideGenAI', checked)}
/>
</div>
</CardContent>
<div className="flex items-center justify-between">
<Label htmlFor="hide-upgrades">Hide all upgrades/roles</Label>
<Switch
id="hide-upgrades"
checked={settings.hideUpgrades}
disabled={loading}
onCheckedChange={(checked) => updateSetting('hideUpgrades', checked)}
/>
</div>
<div className="flex items-center justify-between">
<Label htmlFor="hide-crypto">Hide crypto exchange</Label>
<Switch
id="hide-crypto"
checked={settings.hideCrypto}
disabled={loading}
onCheckedChange={(checked) => updateSetting('hideCrypto', checked)}
/>
</div>
</div>
</Card>
</div>
</motion.div>

View File

@ -46,7 +46,7 @@ export function ChangePassword() {
return (
<Card>
<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>
{/* TODO: please tell me you added password resets to authentik by now */}
</CardHeader>
@ -59,7 +59,6 @@ export function ChangePassword() {
type="password"
value={newPassword}
onChange={(e) => setNewPassword(e.target.value)}
className="mt-1.5"
/>
</div>
<Button type="submit" disabled={loading}>

View File

@ -1,4 +1,3 @@
import React from "react"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
interface FeatureCardProps {

View File

@ -8,4 +8,3 @@ exclude:
- name: All
paths:
- .github/workflows/bump.yml
- components/ui