-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpage.tsx
More file actions
173 lines (161 loc) · 4.15 KB
/
page.tsx
File metadata and controls
173 lines (161 loc) · 4.15 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
'use client';
import Loader, { LoaderContainer } from '@/components/common/Loader';
import OauthButton from '@/components/signup/OauthButton';
import { OAUTH } from '@/constants/oauth';
import { sendLetterState } from '@/recoil/letterStore';
import { theme } from '@/styles/theme';
import { OAuthType } from '@/types/login';
import { clearAnonymousSendLetterCode } from '@/utils/storage';
import { useRouter } from 'next/navigation';
import { Suspense, useEffect } from 'react';
import { useRecoilState } from 'recoil';
import styled from 'styled-components';
export default function Login() {
const router = useRouter();
const [, setSendState] = useRecoilState(sendLetterState);
/* 로그인 페이지에서 편지 쓰기 store 초기화 */
useEffect(() => {
clearAnonymousSendLetterCode();
setSendState({
draftId: null,
senderName: null,
receiverName: '',
content: '',
images: [] as string[],
previewImages: [] as string[],
templateType: 0,
letterId: null
});
}, []);
const handleGuestLetterStart = () => {
router.push('/send/receiver?guest=true');
};
return (
<Container>
<ImageWrapper>
<LogoTitle data="/assets/login/login_text.svg" />
<LogoText>편지로 수놓는 나의 스페이스</LogoText>
<LogoImage src="/assets/login/login_logo.png" />
<OauthWrapper>
<Suspense
fallback={
<LoaderContainer>
<Loader />
</LoaderContainer>
}
>
{OAUTH.map((item) => (
<OauthButton
key={item.key}
loginType={item.key as OAuthType}
bgColor={item.bgColor}
icon={item.icon}
size={item.size}
/>
))}
</Suspense>
</OauthWrapper>
<LetterBtnText onClick={handleGuestLetterStart}>
로그인 없이 편지 보내기
</LetterBtnText>
</ImageWrapper>
</Container>
);
}
const Container = styled.div`
display: flex;
box-sizing: border-box;
height: 100vh;
flex-direction: column;
justify-content: space-between;
background-image: url('/assets/login/login_bg.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
-webkit-scrollbar {
display: none;
}
`;
const LogoTitle = styled.object`
display: flex;
box-sizing: border-box;
width: 70%;
height: auto;
max-width: 257px;
max-height: 150px;
//드래그방지
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
`;
const LogoText = styled.div`
display: flex;
width: 100%;
color: rgba(255, 255, 255, 0.8);
text-align: center;
line-height: 134%; /* 26.8px */
letter-spacing: -0.6px;
${theme.fonts.body07}
justify-content: center;
//드래그방지
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
`;
const LogoImage = styled.img`
display: flex;
width: auto;
height: 100%;
object-fit: cover;
max-width: 520px;
max-height: 520px;
//드래그방지
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
`;
const ImageWrapper = styled.div`
display: flex;
box-sizing: border-box;
padding-top: 100px;
width: 100%;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: hidden;
`;
const OauthWrapper = styled.div`
width: 100%;
max-width: 393px;
gap: 24px;
display: flex;
position: absolute;
bottom: 123px;
justify-content: center;
`;
const LetterBtnText = styled.div`
${(props) => props.theme.fonts.caption02};
color: ${theme.colors.gray400};
position: absolute;
bottom: 69px;
text-decoration-line: underline;
cursor: pointer;
`;