-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
4,340 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/app/globals.css", | ||
"baseColor": "zinc", | ||
"cssVariables": false | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Header } from '@/components/header' | ||
import { ReactNode } from 'react' | ||
|
||
export default function AppLayout({ children }: { children: ReactNode }) { | ||
return ( | ||
<div className="min-h-screen bg-background"> | ||
<Header /> | ||
<main className="mx-auto max-w-6xl p-6">{children}</main> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use client' | ||
|
||
export default function Home() { | ||
return <main className="flex h-screen items-center justify-center">Home</main> | ||
return <main className="flex items-center justify-center">Home</main> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use client' | ||
|
||
import { Button } from '@/components/ui/button' | ||
import { Icons } from '@/components/ui/icons' | ||
import { ArrowRightIcon, GitHubLogoIcon } from '@radix-ui/react-icons' | ||
import { signIn } from 'next-auth/react' | ||
import { useState } from 'react' | ||
|
||
export function SignInGithubButton() { | ||
const [isLoading, setIsLoading] = useState(false) | ||
|
||
function signInWithGithub() { | ||
setIsLoading(true) | ||
|
||
signIn('github', { callbackUrl: '/' }).catch(() => setIsLoading(false)) | ||
} | ||
|
||
return ( | ||
<Button | ||
className="group w-full justify-between" | ||
disabled={isLoading} | ||
onClick={signInWithGithub} | ||
> | ||
<span className="flex items-center gap-1"> | ||
{isLoading ? ( | ||
<Icons.spinner className="h-4 w-4 animate-spin" /> | ||
) : ( | ||
<GitHubLogoIcon className="h-4 w-4" /> | ||
)} | ||
Contiue with Github | ||
</span> | ||
|
||
<ArrowRightIcon className="hidden transition-all group-hover:flex" /> | ||
</Button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,40 @@ | ||
import { Button } from '@/components/button' | ||
import { Metadata } from 'next' | ||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
} from '@/components/ui/card' | ||
import { SignInGithubButton } from './components/sign-in-github-button' | ||
|
||
export default function SignIn() { | ||
export const metadata: Metadata = { | ||
title: 'Sign In', | ||
description: 'Authentication forms built using the components.', | ||
} | ||
|
||
export default function AuthenticationPage() { | ||
return ( | ||
<h1> | ||
SignIn | ||
<Button>Github</Button> | ||
</h1> | ||
<main className="flex h-screen w-full flex-col justify-center"> | ||
<Card className="mx-auto w-full max-w-[456px]"> | ||
<CardHeader> | ||
<CardTitle>Sign In</CardTitle> | ||
<CardDescription>to continue to Dev Xperience</CardDescription> | ||
</CardHeader> | ||
<CardContent> | ||
<SignInGithubButton /> | ||
</CardContent> | ||
|
||
<CardFooter> | ||
<span className="flex items-center gap-1 text-sm"> | ||
No account? | ||
<a href="#" className="text-sm font-bold"> | ||
Sign Up | ||
</a> | ||
</span> | ||
</CardFooter> | ||
</Card> | ||
</main> | ||
) | ||
} |
Oops, something went wrong.