Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[add]ログイン画面のUI #64

Merged
merged 2 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added packages/front/public/discussion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/front/public/ellipse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/front/public/icons/g-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/front/public/logo_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 70 additions & 8 deletions packages/front/src/pages/login.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import React, { useEffect, FC, useReducer } from "react"
import { useRouter } from "next/router"
// import Image from "next/image"
import authReducer from "@reducers/authReducer"
import { useAuth } from "@hooks/useAuth"
import { authUseCase } from "@useCase"
import { useWindowSize } from "@hooks/useWindowSize"
import dynamic from "next/dynamic"
const Image = dynamic(() => import("next/image"), {
ssr: false,
})
Comment on lines +8 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imageをdynamic importじゃなくても動く気がしたんですけどどうでしょうか...👀


const Login: FC = () => {
const router = useRouter()
Expand All @@ -11,6 +17,7 @@ const Login: FC = () => {
authReducer.initialState,
)
const user = useAuth()
const { width, height } = useWindowSize()

useEffect(() => {
user && router.push("/dashboard")
Expand All @@ -26,14 +33,69 @@ const Login: FC = () => {
}

return (
<div>
<button
onClick={logIn}
className="px-4 py-2 text-center text-black border-2 border-gray-400 border-opacity-25 rounded bg-blue-50 hover:bg-gray-200"
>
googleアカウントでログイン
</button>
</div>
<>
<div className="fixed z-0 -top-52 -left-40">
<Image
src="/ellipse.svg"
width={width * 0.4}
height={width * 0.35}
className="z-0 w-full object-fit"
/>
</div>
<div className="fixed z-0 transform rotate-90 -bottom-52 -left-40">
<Image
src="/ellipse.svg"
width={width * 0.4}
height={width * 0.35}
className="z-0 w-full object-fit"
/>
</div>
<div className="fixed z-0 transform rotate-90 top-1/4 -right-44">
<Image
src="/ellipse.svg"
width={width * 0.4}
height={width * 0.35}
className="z-0 w-full object-fit"
/>
</div>
<div className="relative flex-col h-screen px-10">
<div className="z-10 h-2/5">
<h1 className="pt-24 text-4xl font-medium text-gray-600 pl-28 font-monob">
あなたの音声を付箋に。
</h1>
<div className="relative z-10 pl-72">
<Image
src="/logo_black.png"
width={400}
height={160}
className="w-full object-fit"
/>
</div>
</div>
<div className="relative h-3/5" style={{ width: "70%" }}>
<Image
src="/discussion.png"
width={width * 0.7}
height={height * 0.6}
className="w-full object-fit"
/>
</div>
<button
onClick={logIn}
className="absolute py-2 pl-3 pr-8 text-center text-blue-500 bg-white border-2 border-blue-400 rounded-full hover:bg-gray-200 border-opacity-15 top-1/2 right-32"
>
<div className="flex items-center">
<Image
src="/icons/g-logo.png"
width={30}
height={30}
className="w-full object-fit"
/>
<p className="pl-2">Googleアカウントでログイン</p>
</div>
</button>
</div>
</>
)
}

Expand Down