|
1 | 1 | "use client"; |
2 | 2 |
|
3 | | -import { deleteUser } from "@/api/mypage/user"; |
| 3 | +import { deleteUser, logout } from "@/api/mypage/user"; |
4 | 4 | import Button from "@/components/common/Button"; |
5 | 5 | import Check from "@/components/common/Check"; |
6 | 6 | import Dropdown from "@/components/common/Dropdown"; |
7 | 7 | import Input from "@/components/common/Input"; |
8 | 8 | import Loader, { LoaderContainer } from "@/components/common/Loader"; |
9 | 9 | import NavigatorBar from "@/components/common/NavigatorBar"; |
10 | | -import { clearTokens, removeCookie } from "@/utils/storage"; |
| 10 | +import { clearTokens, getRefreshToken, removeCookie } from "@/utils/storage"; |
11 | 11 | import { useRouter } from "next/navigation"; |
12 | 12 | import { Suspense, useEffect, useState } from "react"; |
13 | 13 | import styled from "styled-components"; |
@@ -57,6 +57,31 @@ const DeleteAccount = () => { |
57 | 57 | }); |
58 | 58 | }; |
59 | 59 |
|
| 60 | + // 테스트 해본 코드 |
| 61 | + // const handleDeleteUser = async () => { |
| 62 | + // try { |
| 63 | + // // 회원 탈퇴 요청 |
| 64 | + // const res = await deleteUser(); |
| 65 | + // console.log(res.data); |
| 66 | + |
| 67 | + // // 로그아웃 요청을 위해 refreshToken 가져오기 |
| 68 | + // const refreshToken = getRefreshToken(); |
| 69 | + |
| 70 | + // if (refreshToken) { |
| 71 | + // // 서버 로그아웃 요청 |
| 72 | + // const logoutRes = await logout(refreshToken); |
| 73 | + // console.log(logoutRes.data); |
| 74 | + // } |
| 75 | + |
| 76 | + // clearTokens(); |
| 77 | + // removeCookie("letter-onboard"); |
| 78 | + |
| 79 | + // router.push("/login"); |
| 80 | + // } catch (err) { |
| 81 | + // console.log(err); |
| 82 | + // } |
| 83 | + // }; |
| 84 | + |
60 | 85 | return ( |
61 | 86 | <Container> |
62 | 87 | <Wrapper> |
@@ -127,76 +152,76 @@ export default function SendedLetterPaging() { |
127 | 152 | } |
128 | 153 |
|
129 | 154 | const Container = styled.div` |
130 | | - display: flex; |
131 | | - flex-direction: column; |
132 | | - height: 100%; |
133 | | - min-height: 100%; |
134 | | - max-height: 100%; |
135 | | - justify-content: space-between; |
136 | | - color: white; |
137 | | - background:${(props) => props.theme.colors.bg}; |
| 155 | + display: flex; |
| 156 | + flex-direction: column; |
| 157 | + height: 100%; |
| 158 | + min-height: 100%; |
| 159 | + max-height: 100%; |
| 160 | + justify-content: space-between; |
| 161 | + color: white; |
| 162 | + background: ${(props) => props.theme.colors.bg}; |
138 | 163 | `; |
139 | 164 |
|
140 | 165 | const MainWrapper = styled.div` |
141 | | - display: flex; |
142 | | - flex-direction: column; |
143 | | - padding: 5px 24px; |
144 | | - height: 100%; |
145 | | - overflow-y: auto; |
146 | | - box-sizing: border-box; |
147 | | - &::-webkit-scrollbar { |
148 | | - width: 5px; /* Width of the scrollbar */ |
149 | | - } |
150 | | -
|
151 | | - &::-webkit-scrollbar-track { |
152 | | - background: ${(props: any) => props.theme.colors.gray800}; |
153 | | - border-radius: 10px; /* Rounded corners */ |
154 | | - } |
155 | | -
|
156 | | - &::-webkit-scrollbar-thumb { |
157 | | - background: ${(props: any) => props.theme.colors.gray600}; |
158 | | - border-radius: 10px; /* Rounded corners */ |
159 | | - } |
| 166 | + display: flex; |
| 167 | + flex-direction: column; |
| 168 | + padding: 5px 24px; |
| 169 | + height: 100%; |
| 170 | + overflow-y: auto; |
| 171 | + box-sizing: border-box; |
| 172 | + &::-webkit-scrollbar { |
| 173 | + width: 5px; /* Width of the scrollbar */ |
| 174 | + } |
| 175 | +
|
| 176 | + &::-webkit-scrollbar-track { |
| 177 | + background: ${(props: any) => props.theme.colors.gray800}; |
| 178 | + border-radius: 10px; /* Rounded corners */ |
| 179 | + } |
| 180 | +
|
| 181 | + &::-webkit-scrollbar-thumb { |
| 182 | + background: ${(props: any) => props.theme.colors.gray600}; |
| 183 | + border-radius: 10px; /* Rounded corners */ |
| 184 | + } |
160 | 185 | `; |
161 | 186 |
|
162 | 187 | const Wrapper = styled.div` |
163 | | - display: flex; |
164 | | - width: 100%; |
165 | | - padding: 24px; |
| 188 | + display: flex; |
| 189 | + width: 100%; |
| 190 | + padding: 24px; |
166 | 191 | `; |
167 | 192 |
|
168 | 193 | const MainTitle = styled.div` |
169 | | - ${(props: any) => props.theme.fonts.title01}; |
170 | | - color: ${(props: any) => props.theme.colors.white}; |
171 | | - padding: 9px 0; |
| 194 | + ${(props: any) => props.theme.fonts.title01}; |
| 195 | + color: ${(props: any) => props.theme.colors.white}; |
| 196 | + padding: 9px 0; |
172 | 197 | `; |
173 | 198 |
|
174 | 199 | const SubTitle = styled.div` |
175 | | - ${(props: any) => props.theme.fonts.body08}; |
176 | | - color: ${(props: any) => props.theme.colors.white}; |
177 | | - margin-bottom: 35px; |
| 200 | + ${(props: any) => props.theme.fonts.body08}; |
| 201 | + color: ${(props: any) => props.theme.colors.white}; |
| 202 | + margin-bottom: 35px; |
178 | 203 | `; |
179 | 204 |
|
180 | 205 | const QuestionText = styled.div` |
181 | | - ${(props: any) => props.theme.fonts.subtitle}; |
182 | | - color: ${(props: any) => props.theme.colors.white}; |
183 | | - display : flex; |
184 | | - justify-content: space-between; |
185 | | -
|
186 | | - //글자수 |
187 | | - span { |
188 | | - display: flex; |
189 | | - text-align: center; |
190 | | - align-items: center; |
191 | | - ${(props: any) => props.theme.fonts.caption03}; |
192 | | - color: ${(props: any) => props.theme.colors.white}; |
193 | | - } |
| 206 | + ${(props: any) => props.theme.fonts.subtitle}; |
| 207 | + color: ${(props: any) => props.theme.colors.white}; |
| 208 | + display: flex; |
| 209 | + justify-content: space-between; |
| 210 | +
|
| 211 | + //글자수 |
| 212 | + span { |
| 213 | + display: flex; |
| 214 | + text-align: center; |
| 215 | + align-items: center; |
| 216 | + ${(props: any) => props.theme.fonts.caption03}; |
| 217 | + color: ${(props: any) => props.theme.colors.white}; |
| 218 | + } |
194 | 219 | `; |
195 | 220 |
|
196 | 221 | const QuestionWrapper = styled.div` |
197 | | - display: flex; |
198 | | - width: 100%; |
199 | | - flex-direction: column; |
200 | | - gap: 12px; |
201 | | - padding: 20px 0; |
| 222 | + display: flex; |
| 223 | + width: 100%; |
| 224 | + flex-direction: column; |
| 225 | + gap: 12px; |
| 226 | + padding: 20px 0; |
202 | 227 | `; |
0 commit comments