I LOVE WOMEN
This commit is contained in:
parent
49b01984ab
commit
3932b48a64
10 changed files with 233 additions and 150 deletions
|
@ -1,51 +1,56 @@
|
|||
import { ThemeProvider } from "@/components/theme-provider"
|
||||
import { Button } from './components/ui/button'
|
||||
import { LinkForm } from './components/LinkForm'
|
||||
import { LinkList } from './components/LinkList'
|
||||
import { AuthForms } from './components/AuthForms'
|
||||
import { AuthProvider, useAuth } from './context/AuthContext'
|
||||
import { useState } from 'react'
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Toaster } from './components/ui/toaster'
|
||||
import { ModeToggle } from './components/mode-toggle'
|
||||
import { useState } from 'react'
|
||||
|
||||
function AppContent() {
|
||||
const { user, logout } = useAuth()
|
||||
const [refreshCounter, setRefreshCounter] = useState(0)
|
||||
|
||||
const handleLinkCreated = () => {
|
||||
// Increment refresh counter to trigger list refresh
|
||||
setRefreshCounter(prev => prev + 1)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col">
|
||||
<div className="container max-w-6xl mx-auto py-8 flex-1 flex flex-col">
|
||||
<div className="space-y-8 flex-1 flex flex-col justify-center">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-3xl font-bold">SimpleLink</h1>
|
||||
<div className="min-h-screen bg-background flex flex-col">
|
||||
<header className="border-b">
|
||||
<div className="container max-w-6xl mx-auto flex h-16 items-center justify-between px-4">
|
||||
<h1 className="text-2xl font-bold">SimpleLink</h1>
|
||||
<div className="flex items-center gap-4">
|
||||
{user ? (
|
||||
<div className="flex items-center gap-4">
|
||||
<p className="text-sm text-muted-foreground">Welcome, {user.email}</p>
|
||||
<Button variant="outline" onClick={logout}>
|
||||
<>
|
||||
<span className="text-sm text-muted-foreground">Welcome, {user.email}</span>
|
||||
<Button variant="outline" size="sm" onClick={logout}>
|
||||
Logout
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="flex items-center gap-4">
|
||||
<p className="text-sm text-muted-foreground">A link shortening and tracking service</p>
|
||||
</div>
|
||||
<span className="text-sm text-muted-foreground">A link shortening and tracking service</span>
|
||||
)}
|
||||
<ModeToggle />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main className="flex-1 flex flex-col">
|
||||
<div className="container max-w-6xl mx-auto px-4 py-8 flex-1 flex flex-col">
|
||||
<div className="space-y-8 flex-1 flex flex-col justify-center">
|
||||
{user ? (
|
||||
<>
|
||||
<LinkForm onSuccess={handleLinkCreated} />
|
||||
<LinkList refresh={refreshCounter} />
|
||||
</>
|
||||
) : (
|
||||
<AuthForms />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{user ? (
|
||||
<>
|
||||
<LinkForm onSuccess={handleLinkCreated} />
|
||||
<LinkList refresh={refreshCounter} />
|
||||
</>
|
||||
) : (
|
||||
<AuthForms />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue