From c46dcb440df137767b807f7173350b99c8f323b5 Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Mon, 16 Mar 2026 10:13:01 -0400 Subject: [PATCH] wip 8 --- frontend/src/components/Toast.tsx | 6 +++++- frontend/src/components/ToastContext.tsx | 2 +- frontend/src/index.css | 16 ++++++++++++++++ frontend/src/pages/SettingsPage.tsx | 22 ++++++++++++++-------- 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Toast.tsx b/frontend/src/components/Toast.tsx index 16fb68c..8cdff1f 100644 --- a/frontend/src/components/Toast.tsx +++ b/frontend/src/components/Toast.tsx @@ -68,7 +68,11 @@ export function Toast({ id, type, message, duration = 5000, onClose }: ToastProp return (
{icons[type]}

diff --git a/frontend/src/components/ToastContext.tsx b/frontend/src/components/ToastContext.tsx index c956e73..d6227dc 100644 --- a/frontend/src/components/ToastContext.tsx +++ b/frontend/src/components/ToastContext.tsx @@ -59,7 +59,7 @@ function ToastContainer({ toasts }: ToastContainerProps) { } return ( -

+
{toasts.map((toast) => ( diff --git a/frontend/src/index.css b/frontend/src/index.css index 624842c..e72583c 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -129,4 +129,20 @@ main { rgb(75, 85, 99) 100% ); background-size: 200% 100%; +} + +/* Toast Slide In Animation */ +@keyframes slideInRight { + 0% { + opacity: 0; + transform: translateX(100%); + } + 100% { + opacity: 1; + transform: translateX(0); + } +} + +.animate-slideInRight { + animation: slideInRight 0.3s ease-out forwards; } \ No newline at end of file diff --git a/frontend/src/pages/SettingsPage.tsx b/frontend/src/pages/SettingsPage.tsx index ae1ef31..ffa5165 100644 --- a/frontend/src/pages/SettingsPage.tsx +++ b/frontend/src/pages/SettingsPage.tsx @@ -1,4 +1,4 @@ -import { useState, FormEvent } from 'react'; +import { useState, useEffect, FormEvent } from 'react'; import { useGetSettings, useUpdateSettings } from '../generated/anthoLumeAPIV1'; import { User, Lock, Clock } from 'lucide-react'; import { Button } from '../components/Button'; @@ -7,12 +7,18 @@ import { useToasts } from '../components/ToastContext'; export default function SettingsPage() { const { data, isLoading } = useGetSettings(); const updateSettings = useUpdateSettings(); - const settingsData = data?.data; + const settingsData = data; const { showInfo, showError } = useToasts(); const [password, setPassword] = useState(''); const [newPassword, setNewPassword] = useState(''); - const [timezone, setTimezone] = useState(settingsData?.timezone || ''); + const [timezone, setTimezone] = useState('UTC'); + + useEffect(() => { + if (settingsData?.data.timezone && settingsData.data.timezone.trim() !== '') { + setTimezone(settingsData.data.timezone); + } + }, [settingsData]); const handlePasswordSubmit = async (e: FormEvent) => { e.preventDefault(); @@ -99,7 +105,7 @@ export default function SettingsPage() { className="flex flex-col p-4 items-center rounded shadow-lg md:w-60 lg:w-80 bg-white dark:bg-gray-700 text-gray-500 dark:text-white" > -

{settingsData?.user?.username}

+

{settingsData?.data.user.username || "N/A"}

@@ -167,7 +173,7 @@ export default function SettingsPage() {