clerk #1
3 changed files with 67 additions and 31 deletions
40
apps/remix-template/app/routes/clerk._index.tsx
Normal file
40
apps/remix-template/app/routes/clerk._index.tsx
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import { SignInButton, UserButton, SignedIn, SignedOut } from "@clerk/remix";
|
||||||
|
import {
|
||||||
|
Card,
|
||||||
|
CardContent,
|
||||||
|
CardHeader,
|
||||||
|
CardTitle,
|
||||||
|
} from "@repo/ui/components/card";
|
||||||
|
import { Button } from "@repo/ui/components/button";
|
||||||
|
|
||||||
|
export default function Index() {
|
||||||
|
return (
|
||||||
|
<div className="flex min-h-screen items-center justify-center">
|
||||||
|
<Card className="w-full max-w-md shadow-lg">
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle className="text-center">Welcome</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<SignedIn>
|
||||||
|
<div className="flex flex-col items-center gap-4">
|
||||||
|
<p className="text-green-700 font-medium">
|
||||||
|
You are signed in!
|
||||||
|
</p>
|
||||||
|
<UserButton />
|
||||||
|
</div>
|
||||||
|
</SignedIn>
|
||||||
|
<SignedOut>
|
||||||
|
<div className="flex flex-col items-center gap-4">
|
||||||
|
<p className="text-red-700 font-medium">
|
||||||
|
You are signed out
|
||||||
|
</p>
|
||||||
|
<SignInButton mode="modal">
|
||||||
|
<Button variant="default">Sign In</Button>
|
||||||
|
</SignInButton>
|
||||||
|
</div>
|
||||||
|
</SignedOut>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,40 +1,24 @@
|
||||||
import { SignInButton, UserButton, SignedIn, SignedOut } from "@clerk/remix";
|
import { SignInButton, UserButton, SignedIn, SignedOut } from "@clerk/remix";
|
||||||
import {
|
|
||||||
Card,
|
|
||||||
CardContent,
|
|
||||||
CardHeader,
|
|
||||||
CardTitle,
|
|
||||||
} from "@repo/ui/components/card";
|
|
||||||
import { Button } from "@repo/ui/components/button";
|
import { Button } from "@repo/ui/components/button";
|
||||||
|
import { Outlet } from "@remix-run/react";
|
||||||
|
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen items-center justify-center bg-muted">
|
<div>
|
||||||
<Card className="w-full max-w-md shadow-lg">
|
<header className="flex items-center justify-end py-4 px-6 bg-white shadow-sm mb-6">
|
||||||
<CardHeader>
|
<div>
|
||||||
<CardTitle className="text-center">Welcome</CardTitle>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent>
|
|
||||||
<SignedIn>
|
|
||||||
<div className="flex flex-col items-center gap-4">
|
|
||||||
<p className="text-green-700 font-medium">
|
|
||||||
You are signed in!
|
|
||||||
</p>
|
|
||||||
<UserButton />
|
|
||||||
</div>
|
|
||||||
</SignedIn>
|
|
||||||
<SignedOut>
|
<SignedOut>
|
||||||
<div className="flex flex-col items-center gap-4">
|
<SignInButton mode="modal">
|
||||||
<p className="text-red-700 font-medium">
|
<Button variant="outline">Sign In</Button>
|
||||||
You are signed out
|
</SignInButton>
|
||||||
</p>
|
|
||||||
<SignInButton>
|
|
||||||
<Button variant="default">Sign In</Button>
|
|
||||||
</SignInButton>
|
|
||||||
</div>
|
|
||||||
</SignedOut>
|
</SignedOut>
|
||||||
</CardContent>
|
<SignedIn>
|
||||||
</Card>
|
<UserButton />
|
||||||
|
</SignedIn>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ function App() {
|
||||||
</SignInButton>
|
</SignInButton>
|
||||||
</SignedOut>
|
</SignedOut>
|
||||||
<SignedIn>
|
<SignedIn>
|
||||||
<UserButton afterSignOutUrl="/" />
|
<UserButton />
|
||||||
</SignedIn>
|
</SignedIn>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
@ -39,6 +39,7 @@ function App() {
|
||||||
<span>Kitchen Sink</span>
|
<span>Kitchen Sink</span>
|
||||||
</h1>
|
</h1>
|
||||||
<CounterButton />
|
<CounterButton />
|
||||||
|
|
||||||
<Card className="my-6">
|
<Card className="my-6">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>shadcn/ui Card Example</CardTitle>
|
<CardTitle>shadcn/ui Card Example</CardTitle>
|
||||||
|
|
@ -47,6 +48,17 @@ function App() {
|
||||||
<Button>shadcn/ui Button</Button>
|
<Button>shadcn/ui Button</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
<Card className="my-6">
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>Clerk Authentication Example</CardTitle>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<SignedOut>You are signed out!</SignedOut>
|
||||||
|
<SignedIn>You are signed in!</SignedIn>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
|
||||||
<p className="description">
|
<p className="description">
|
||||||
Built With{" "}
|
Built With{" "}
|
||||||
<Link href="https://turborepo.com" newTab>
|
<Link href="https://turborepo.com" newTab>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue