different small fixes
This commit is contained in:
@@ -16,7 +16,7 @@ export default async function ExperimentsAdminPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className='px-4 sm:px-6 lg:px-8 py-8'>
|
||||||
<Link
|
<Link
|
||||||
href="/admin"
|
href="/admin"
|
||||||
className="text-blue-500 hover:text-blue-600 mb-6 inline-block"
|
className="text-blue-500 hover:text-blue-600 mb-6 inline-block"
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ export default function RootLayout({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<html>
|
<html>
|
||||||
<body className="flex flex-col min-h-screen md:h-screen">
|
<body className="flex flex-col min-h-screen">
|
||||||
<AudioProvider>
|
<AudioProvider>
|
||||||
<Header />
|
<Header />
|
||||||
<main className="flex-1 overflow-hidden">
|
<main className="flex-grow">
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default function AnnotationSidebarNavigation({
|
|||||||
<h3 className="text-xs font-semibold text-gray-700 uppercase tracking-wide mb-3 px-2 flex-shrink-0">
|
<h3 className="text-xs font-semibold text-gray-700 uppercase tracking-wide mb-3 px-2 flex-shrink-0">
|
||||||
Samples
|
Samples
|
||||||
</h3>
|
</h3>
|
||||||
<div className="space-y-1 overflow-y-auto max-h-96">
|
<div className="space-y-1 overflow-y-auto max-h-150">
|
||||||
{entries.map((entry, index) => (
|
{entries.map((entry, index) => (
|
||||||
<button
|
<button
|
||||||
ref={index === currentIndex ? activeButtonRef : null}
|
ref={index === currentIndex ? activeButtonRef : null}
|
||||||
@@ -77,7 +77,7 @@ export default function AnnotationSidebarNavigation({
|
|||||||
/>
|
/>
|
||||||
{/* Entry number and filename */}
|
{/* Entry number and filename */}
|
||||||
<span className="truncate">
|
<span className="truncate">
|
||||||
{index + 1}. {`Sample ${index + 1}`}
|
{`Sample ${index + 1}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { authClient } from '@/lib/auth-client';
|
import { authClient } from '@/lib/auth-client';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
type AuthMode = 'signin' | 'signup';
|
type AuthMode = 'signin' | 'signup';
|
||||||
|
|
||||||
export function AuthForm() {
|
export function AuthForm() {
|
||||||
|
const router = useRouter();
|
||||||
const [mode, setMode] = useState<AuthMode>('signin');
|
const [mode, setMode] = useState<AuthMode>('signin');
|
||||||
const [email, setEmail] = useState('');
|
const [email, setEmail] = useState('');
|
||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
@@ -26,6 +28,8 @@ export function AuthForm() {
|
|||||||
});
|
});
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
setError(response.error.message || 'Authentifizierung fehlgeschlagen');
|
setError(response.error.message || 'Authentifizierung fehlgeschlagen');
|
||||||
|
} else {
|
||||||
|
router.push('/');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (password !== confirmPassword) {
|
if (password !== confirmPassword) {
|
||||||
@@ -40,7 +44,10 @@ export function AuthForm() {
|
|||||||
});
|
});
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
setError(response.error.message || 'Registrierung fehlgeschlagen');
|
setError(response.error.message || 'Registrierung fehlgeschlagen');
|
||||||
|
} else {
|
||||||
|
router.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setError(err.message || 'Ein Fehler ist aufgetreten');
|
setError(err.message || 'Ein Fehler ist aufgetreten');
|
||||||
@@ -50,7 +57,7 @@ export function AuthForm() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center py-12">
|
<div className="flex items-center justify-center py-8 px-4">
|
||||||
<div className="w-full max-w-md">
|
<div className="w-full max-w-md">
|
||||||
{/* Card */}
|
{/* Card */}
|
||||||
<div className="bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200">
|
<div className="bg-white rounded-lg shadow-lg overflow-hidden border border-gray-200">
|
||||||
|
|||||||
@@ -3,14 +3,17 @@
|
|||||||
import { authClient } from '@/lib/auth-client';
|
import { authClient } from '@/lib/auth-client';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
|
||||||
export function Header() {
|
export function Header() {
|
||||||
|
const router = useRouter();
|
||||||
const { data: session, isPending: loading } = authClient.useSession();
|
const { data: session, isPending: loading } = authClient.useSession();
|
||||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||||
|
|
||||||
const handleSignOut = async () => {
|
const handleSignOut = async () => {
|
||||||
try {
|
try {
|
||||||
await authClient.signOut({});
|
await authClient.signOut({});
|
||||||
|
router.push('/');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Sign out failed:', error);
|
console.error('Sign out failed:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user