Skip to content

Commit

Permalink
Merge pull request #64 from jphacks/feature/login-ui
Browse files Browse the repository at this point in the history
[add]ログイン画面のUI
  • Loading branch information
yuta-ike authored Oct 30, 2021
2 parents f7a9b46 + 27c7f2e commit 89d9f16
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 8 deletions.
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,
})

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

0 comments on commit 89d9f16

Please sign in to comment.