-
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
16 changed files
with
169 additions
and
54 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,19 @@ | ||
{ | ||
"name": "Next starter", | ||
"short_name": "NS", | ||
"icons": [ | ||
{ | ||
"src": "/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/android-chrome-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"theme_color": "#ffffff", | ||
"background_color": "#ffffff", | ||
"display": "standalone" | ||
} |
Binary file not shown.
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,38 @@ | ||
'use client'; | ||
|
||
import { useTransition } from 'react'; | ||
import { signIn } from 'next-auth/react'; | ||
|
||
import Icons from '../common/icons'; | ||
|
||
import { Button } from '@/components/ui/button'; | ||
import * as m from '@/paraglide/messages'; | ||
|
||
type Props = { | ||
provider: 'github' | 'google'; | ||
}; | ||
export const SignInButton = ({ provider }: Props) => { | ||
const [isPending, startTransition] = useTransition(); | ||
|
||
const handleSignIn = () => { | ||
startTransition(async () => { | ||
if (provider === 'google') await signIn('google'); | ||
else await signIn('github'); | ||
}); | ||
}; | ||
|
||
return ( | ||
<Button onClick={handleSignIn} disabled={isPending} className="space-x-2"> | ||
{isPending ? ( | ||
<Icons.loader className="size-4" /> | ||
) : ( | ||
<div className="size-4"> | ||
{provider === 'github' ? <Icons.gitHub /> : <Icons.google />} | ||
</div> | ||
)} | ||
<div> | ||
{provider === 'github' ? m.sign_in_github() : m.sign_in_google()} | ||
</div> | ||
</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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client'; | ||
|
||
import { useTransition } from 'react'; | ||
import { signOut } from 'next-auth/react'; | ||
|
||
import Icons from '../common/icons'; | ||
import { Button } from '../ui/button'; | ||
|
||
const SignOutButton = () => { | ||
const [isPending, startTransition] = useTransition(); | ||
const handelSignOut = async () => { | ||
startTransition(async () => await signOut()); | ||
}; | ||
return ( | ||
<Button | ||
variant="destructive" | ||
onClick={handelSignOut} | ||
className="space-x-2" | ||
disabled={isPending} | ||
> | ||
<div>Sign Out</div> | ||
{isPending ? ( | ||
<Icons.loader className="size-4" /> | ||
) : ( | ||
<Icons.logout className="size-4" /> | ||
)} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default SignOutButton; |
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
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