-
Notifications
You must be signed in to change notification settings - Fork 75
/
login.tsx
129 lines (115 loc) · 3.07 KB
/
login.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import React from 'react';
import styled, { css } from 'styled-components';
import tw from 'tailwind.macro';
import Fathom from 'fathom-client';
import { userSession } from '../utils/blockstack';
import { config } from '../config';
import { Button } from '../components';
import { Goals } from '../utils/fathom';
const BackgroundContainer = styled.div`
${tw`flex w-full h-screen`};
@media (max-width: ${config.breakpoints.md}px) {
display: none;
}
`;
const BackgroundColumn = styled.div<{ right?: boolean }>`
${tw`flex-1`};
background-color: #f7f7f7;
${props =>
props.right &&
css`
${tw`bg-white bg-no-repeat bg-contain bg-left`};
background-image: url('/static/img/logo-login.png');
`}
`;
const AbsoluteContainer = styled.div`
${tw`absolute w-full h-screen`};
top: 0;
`;
const Container = styled.div`
${tw`flex items-center justify-center p-8 mx-auto`};
height: 100%;
width: 100%;
max-width: 1140px;
@media (max-width: ${config.breakpoints.md}px) {
${tw`block`};
}
`;
const Column = styled.div<{ left?: boolean; right?: boolean }>`
${tw`w-1/2 flex flex-col text-left`};
${props =>
props.left &&
css`
${tw`pr-32`};
`}
${props =>
props.right &&
css`
${tw`items-center`};
`}
@media (max-width: ${config.breakpoints.md}px) {
${tw`w-full pr-0`};
}
`;
const Logo = styled.img`
${tw`mb-4`};
width: 100px;
`;
const Illu = styled.img`
${tw`mt-6 mb-4`};
width: 400px;
max-width: 100%;
`;
const Text = styled.p`
${tw`mb-4`};
`;
const Link = styled.a`
${tw`text-pink`};
`;
const Login = () => {
const handleLogin = () => {
Fathom.trackGoal(Goals.LOGIN, 0);
userSession.redirectToSignIn();
};
return (
<React.Fragment>
<BackgroundContainer>
<BackgroundColumn />
<BackgroundColumn right />
</BackgroundContainer>
<AbsoluteContainer>
<Container>
<Column left>
<Logo src="/static/img/logo.png" alt="Logo" />
<Text>
Because Sigle is working on the decentralized internet thanks to
the blockchain technology, you’ll be redicrected to{' '}
<Link href="https://blockstack.org/" target="_blank">
Blockstack
</Link>{' '}
to login or sign in.
</Text>
<Text>
Blockstack ID provides user-controlled login and storage that
enable you to take back control of your identity and data.
</Text>
<Text>Creating a Blockstack ID is easy, free, and secure.</Text>
<Text>
Welcome to the family{' '}
<span role="img" aria-label="Smile">
🙂
</span>
</Text>
<div>
<Button onClick={handleLogin}>Login with blockstack</Button>
</div>
</Column>
<Column right>
<Illu src="/static/img/login.png" alt="Login image" />
</Column>
</Container>
</AbsoluteContainer>
</React.Fragment>
);
};
export default Login;