feat: restyle LogoutButton and RefreshButton, complete redesign

This commit is contained in:
2026-03-21 22:18:33 +01:00
parent 71fa228013
commit 5360bb51c4
2 changed files with 8 additions and 9 deletions

View File

@@ -2,15 +2,16 @@
import { logoutAction } from '@/lib/actions/auth'; import { logoutAction } from '@/lib/actions/auth';
import { useActionState } from 'react'; import { useActionState } from 'react';
import { Button } from '@/components/ui/Button';
export default function LogoutButton() { export default function LogoutButton() {
const [, formAction] = useActionState(logoutAction, null); const [, formAction] = useActionState(logoutAction, null);
return ( return (
<form action={formAction}> <form action={formAction}>
<button type="submit" className="flex items-center text-gray-300 hover:text-white"> <Button type="submit" variant="ghost" size="sm" className="flex items-center gap-1">
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
className="h-6 w-6" className="h-4 w-4"
fill="none" fill="none"
viewBox="0 0 24 24" viewBox="0 0 24 24"
stroke="currentColor" stroke="currentColor"
@@ -22,8 +23,8 @@ export default function LogoutButton() {
d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
/> />
</svg> </svg>
<span className="ml-1 hidden sm:inline">Logout</span> <span className="hidden sm:inline">Logout</span>
</button> </Button>
</form> </form>
); );
} }

View File

@@ -1,15 +1,13 @@
'use client'; 'use client';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import { Button } from '@/components/ui/Button';
export default function RefreshButton() { export default function RefreshButton() {
const router = useRouter(); const router = useRouter();
return ( return (
<button <Button variant="ghost" size="sm" onClick={() => router.refresh()}>
onClick={() => router.refresh()}
className="rounded-md bg-gray-700 px-3 py-1 text-sm hover:bg-gray-600"
>
Refresh Refresh
</button> </Button>
); );
} }