Bring the codebase in line with CLAUDE.md conventions
- Convert getRouter, OrderingPage, and OrderStatusRoute from function declarations to arrow functions - Migrate header-user.tsx off raw Tailwind classes onto a co-located SCSS module, and remove Tailwind entirely (deps, Vite plugin, styles.css) since it was the only consumer and duplicated the documented SCSS Modules system - Fix CLAUDE.md's stale ~/ alias example and structure diagram to match the project's actual #/ and @/ aliases and directories Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,31 +1,29 @@
|
||||
import { authClient } from '#/lib/auth-client'
|
||||
|
||||
import styles from './header-user.module.scss'
|
||||
|
||||
const BetterAuthHeader = () => {
|
||||
const { data: session, isPending } = authClient.useSession()
|
||||
|
||||
if (isPending) {
|
||||
return (
|
||||
<div className="h-8 w-8 bg-neutral-100 dark:bg-neutral-800 animate-pulse" />
|
||||
)
|
||||
return <div className={`${styles.avatar} ${styles.avatarPulse}`} />
|
||||
}
|
||||
|
||||
if (session?.user) {
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<div className={styles.session}>
|
||||
{session.user.image ? (
|
||||
<img src={session.user.image} alt="" className="h-8 w-8" />
|
||||
<img src={session.user.image} alt="" className={styles.avatar} />
|
||||
) : (
|
||||
<div className="h-8 w-8 bg-neutral-100 dark:bg-neutral-800 flex items-center justify-center">
|
||||
<span className="text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
||||
{session.user.name.charAt(0).toUpperCase() || 'U'}
|
||||
</span>
|
||||
<div className={`${styles.avatar} ${styles.avatarInitial}`}>
|
||||
<span>{session.user.name.charAt(0).toUpperCase() || 'U'}</span>
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
onClick={() => {
|
||||
void authClient.signOut()
|
||||
}}
|
||||
className="flex-1 h-9 px-4 text-sm font-medium bg-white dark:bg-neutral-900 text-neutral-900 dark:text-neutral-50 border border-neutral-300 dark:border-neutral-700 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors"
|
||||
className={styles.signOut}
|
||||
>
|
||||
Sign out
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user