-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from 3I-shikosai32/feat/18-sign_up
- Loading branch information
Showing
3 changed files
with
51 additions
and
1 deletion.
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,11 @@ | ||
import type { NextPage } from 'next'; | ||
import { Layout } from '../../presentation/layout/layout.container'; | ||
import { Auth } from '../../presentation/relevant/auth/auth.page'; | ||
|
||
const AuthPage: NextPage = () => ( | ||
<Layout title="サインイン・サインアップ | OZ"> | ||
<Auth /> | ||
</Layout> | ||
); | ||
|
||
export default AuthPage; |
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,39 @@ | ||
import Router from 'next/router'; | ||
import { FC, useState } from 'react'; | ||
import { FcGoogle } from 'react-icons/fc'; | ||
import { Button, ButtonIcon } from '../../primitive/component/button/button.presenter'; | ||
import { Card } from '../../primitive/component/card/card.presenter'; | ||
import { loginWithGoogle } from '@/infra/firebase/auth'; | ||
|
||
export const Auth: FC = () => { | ||
const [isLoading, setIsLoading] = useState(false); | ||
|
||
return ( | ||
<Card className="my-24 py-5 px-10"> | ||
<h1 className="text-center"> | ||
<span className="text-2xl font-semibold">sign in / sign up</span> | ||
</h1> | ||
<div className="my-5"> | ||
<Button | ||
disabled={isLoading} | ||
className="bg-secondary-300" | ||
onClick={async () => { | ||
setIsLoading(true); | ||
await loginWithGoogle().catch(() => { | ||
setIsLoading(false); | ||
}); | ||
if (isLoading) { | ||
Router.push('/auth/is-new-user'); | ||
} | ||
setIsLoading(false); | ||
}} | ||
> | ||
<ButtonIcon> | ||
<FcGoogle /> | ||
</ButtonIcon> | ||
Googleでログインする | ||
</Button> | ||
</div> | ||
</Card> | ||
); | ||
}; |
744102d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
shikosai32 – ./
3i-shikosai32.vercel.app
shikosai32-git-main-3-i-shikosai32.vercel.app
shikosai32-3-i-shikosai32.vercel.app
3i.shikosai.net