1
1
import {
2
- Box ,
3
2
Button ,
4
3
Card ,
5
4
CardBody ,
6
5
CardHeader ,
7
- Center ,
8
6
Divider ,
9
7
Heading ,
10
8
Stack ,
11
9
Text ,
10
+ Box ,
12
11
} from "@chakra-ui/react" ;
13
12
import {
14
13
GoogleAuthProvider ,
@@ -22,7 +21,6 @@ import { FaGithub } from "react-icons/fa";
22
21
import { FaDoorOpen } from "react-icons/fa6" ;
23
22
import { useNavigate } from "react-router-dom" ;
24
23
25
-
26
24
export const SignIn = ( ) => {
27
25
const { auth } = firebaseServices ;
28
26
const navigate = useNavigate ( ) ;
@@ -35,6 +33,7 @@ export const SignIn = () => {
35
33
return result ;
36
34
} ) ;
37
35
} ;
36
+
38
37
const signInWithGithub = ( ) : Promise < UserCredential > => {
39
38
const provider = new GithubAuthProvider ( ) ;
40
39
return signInWithPopup ( auth , provider ) . then ( ( result ) => {
@@ -44,48 +43,50 @@ export const SignIn = () => {
44
43
} ) ;
45
44
} ;
46
45
47
-
48
46
return (
49
- < >
50
- < Center h = "100vh" position = "relative" overflow = "hidden" >
51
- < Box
52
- position = "absolute"
53
- top = "0"
54
- left = "0"
55
- right = "0"
56
- bottom = "0"
57
- bgImage = { `url(https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/3279945/533e08f0-f2da-d547-bfcc-276c3123c0ec.jpeg)` }
58
- bgSize = "cover"
59
- bgPosition = "center"
60
- filter = "brightness(70%)"
61
- zIndex = "-1"
62
- />
63
- < Card p = "10" mb = "20px" maxW = "lg" boxShadow = "lg" >
64
- < CardHeader >
65
- < Stack align = "center" >
66
- < FaDoorOpen size = "30px" />
67
-
68
- < Heading size = "lg" data-testid = "auth-page-title" > Sign in</ Heading >
69
- < Text mt = "4" textAlign = "center" fontSize = "sm" >
70
- Please sign in with your Google or GitHub account!
71
- </ Text >
72
- </ Stack >
73
- </ CardHeader >
74
- < Divider borderColor = "gray.400" />
75
- < CardBody >
76
- < Stack >
77
- < Button onClick = { signInWithGoogle } fontSize = "20px" p = "25px" >
78
- < FcGoogle size = "30px" style = { { marginRight : "8px" } } />
79
- Googleでログイン
80
- </ Button >
81
- < Button onClick = { signInWithGithub } fontSize = "20px" p = "25px" >
82
- < FaGithub size = "30px" style = { { marginRight : "8px" } } />
83
- Githubでログイン
84
- </ Button >
85
- </ Stack >
86
- </ CardBody >
87
- </ Card >
88
- </ Center >
89
- </ >
47
+ < Box
48
+ h = "100vh"
49
+ bgGradient = "linear(to-r, blackAlpha.500, blue.500,cyan.400)"
50
+ display = "flex"
51
+ alignItems = "center"
52
+ justifyContent = "center"
53
+ >
54
+ < Card p = "10" mb = "20px" maxW = "lg" boxShadow = "xl" bgColor = "gray.50" borderRadius = "30px" >
55
+ < CardHeader >
56
+ < Stack align = "center" >
57
+ < FaDoorOpen size = "30px" />
58
+ < Heading size = "lg" data-testid = "auth-page-title" >
59
+ Sign in
60
+ </ Heading >
61
+ < Text mt = "4" textAlign = "center" fontSize = "sm" >
62
+ Please sign in with your Google or GitHub account!
63
+ </ Text >
64
+ </ Stack >
65
+ </ CardHeader >
66
+ < Divider borderColor = "gray.400" />
67
+ < CardBody >
68
+ < Stack >
69
+ < Button
70
+ onClick = { signInWithGoogle }
71
+ fontSize = "20px"
72
+ p = "25px"
73
+ border = "1px"
74
+ >
75
+ < FcGoogle size = "30px" style = { { marginRight : "8px" } } />
76
+ Googleでログイン
77
+ </ Button >
78
+ < Button
79
+ onClick = { signInWithGithub }
80
+ fontSize = "20px"
81
+ p = "25px"
82
+ border = "1px"
83
+ >
84
+ < FaGithub size = "30px" style = { { marginRight : "8px" } } />
85
+ Githubでログイン
86
+ </ Button >
87
+ </ Stack >
88
+ </ CardBody >
89
+ </ Card >
90
+ </ Box >
90
91
) ;
91
92
} ;
0 commit comments