Skip to content

Commit d53a77d

Browse files
authored
[SSD-145] 타임페이퍼 상세 페이지 예외처리 및 기능 구현 (#87)
* [SSD-145] fix: Alert css 수정 * [SSD-145] fix: signUp InvalidMessage 계산 로직 버그 수정 * [SSD-145] feat: 바텀 버튼 fixed 구현 * [SSD-145] feat: 무한 스크롤 구현 * [SSD-145] fix: postit content css 수정 * [SSD-145] feat: TimePaperDetail 페이지 Error Alert 구현 * [SSD-145] feat: 잠긴 타임페이퍼 예외처리 구현
1 parent ebdf344 commit d53a77d

File tree

13 files changed

+186
-121
lines changed

13 files changed

+186
-121
lines changed

frontend/src/api/api.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,13 @@ export const api = {
100100
return response;
101101
},
102102

103-
getPostits: async (timepaperId) => {
104-
const response = await apiInstance.get(`/timepapers/${timepaperId}/postits`);
103+
getPostits: async (timepaperId, page, size = 10) => {
104+
const response = await apiInstance.get(`/timepapers/${timepaperId}/postits`, {
105+
params: {
106+
page: page,
107+
size: size,
108+
},
109+
});
105110
return response;
106111
},
107112

@@ -114,8 +119,8 @@ export const api = {
114119
return response;
115120
},
116121

117-
deletePostit: async (postitId) => {
118-
const response = await apiInstance.delete(`/postits/${postitId}`)
122+
deletePostit: async (postitId) => {
123+
const response = await apiInstance.delete(`/postits/${postitId}`);
119124
return response;
120125
},
121126

frontend/src/components/Alert/Alert.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import styles from './Alert.module.css';
33

44
export default function Alert({ message, buttonTitle, onClick }) {
55
return (
6-
<div className={styles.container}>
7-
<div className={styles.message}>{message}</div>
8-
<button className={styles.button} onClick={onClick}>
9-
{buttonTitle}
10-
</button>
6+
<div className={styles.alertOverlay}>
7+
<div className={styles.alert}>
8+
<div className={styles.message}>{message}</div>
9+
<button className={styles.button} onClick={onClick}>
10+
{buttonTitle}
11+
</button>
12+
</div>
1113
</div>
1214
);
1315
}

frontend/src/components/Alert/Alert.module.css

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
.container {
2-
position: absolute;
3-
background-color: white;
1+
.alertOverlay {
2+
position: fixed;
3+
top: 0;
4+
left: 0;
45
width: 100%;
56
height: 100%;
7+
background-color: rgba(0, 0, 0, 0.5);
8+
display: flex;
9+
justify-content: center;
10+
align-items: center;
11+
z-index: 1500;
12+
}
13+
14+
.alert {
15+
background-color: white;
16+
padding: 20px;
17+
border-radius: 8px;
18+
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
19+
width: 260px;
20+
height: 180px;
621
display: flex;
722
flex-direction: column;
8-
justify-content: space-around;
923
align-items: center;
10-
font-family: var(--pretendard-bold);
11-
font-size: 3rem;
12-
z-index: 1000;
13-
border-radius: 15px;
24+
justify-content: center;
1425
}
1526

1627
.message {
@@ -20,11 +31,12 @@
2031
margin-top: 10%;
2132
width: 80%;
2233
text-align: center;
34+
margin-bottom: 20%;
2335
}
2436

2537
.button {
2638
width: 80%;
27-
height: 20%;
39+
height: 25%;
2840
border-radius: 5px;
2941
border: none;
3042
background-color: var(--orange-color);

frontend/src/components/Loading/Loading.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.loadingOverlay {
2-
position: absolute;
2+
position: fixed;
33
top: 0;
44
left: 0;
55
right: 0;

frontend/src/main.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { Provider } from 'react-redux';
55
import store from './store/store';
66

77
createRoot(document.getElementById('root')).render(
8-
<StrictMode>
8+
// <StrictMode>
99
<Provider store={store}>
1010
<App />
1111
</Provider>
12-
</StrictMode>,
12+
// </StrictMode>,
1313
);

frontend/src/pages/login/Login.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,11 @@ export default function Login() {
7272
<>
7373
<div className={styles.container}>
7474
{isAlertShow && (
75-
<div className={styles.alertContainer}>
7675
<Alert
7776
buttonTitle={'확인'}
7877
message={'로그인 실패했습니다.'}
7978
onClick={handleAlertButtonClick}
8079
></Alert>
81-
</div>
8280
)}
8381
<img src={staticImagePath.timepaperLogo} className="logo-image" />
8482
<form action="" className={styles.formContainer}>

frontend/src/pages/login/Login.module.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@
66
align-items: center;
77
}
88

9-
.alertContainer {
10-
position: absolute;
11-
top: 60%;
12-
left: 50%;
13-
transform: translate(-50%, -50%);
14-
width: 300px;
15-
min-height: 210px;
16-
}
17-
18-
199
.formContainer {
2010
display: flex;
2111
flex-direction: column;

frontend/src/pages/signup/SignUp.jsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react';
1+
import React, { useState, useEffect, useMemo } from 'react';
22
import styles from './SignUp.module.css';
33
import BottomButton from '../../components/BottomButton/BottomButton';
44
import { api } from '../../api/api';
@@ -129,14 +129,16 @@ export default function SignUp() {
129129

130130
const handlePasswordChange = (e) => {
131131
const value = e.target.value.replace(/(\s*)/g, '');
132-
setPassword(value);
133-
134132
const check = /[`~!@#$%^&*|\\\'\";:\/?]/gi;
135133

136134
setVerification((prev) => ({
137135
...prev,
138136
passwordConstraints: check.test(value) && value.length >= 8,
139137
}));
138+
setPassword(value);
139+
140+
console.log(value)
141+
console.log(check.test(value) && value.length >= 8)
140142
};
141143

142144
const handlePasswordCheck = (e) => {
@@ -188,17 +190,15 @@ export default function SignUp() {
188190
: styles.invalidMessageVisible;
189191
};
190192

193+
const resolvedPasswordInvalidStyle = useMemo(() => {
194+
return resolveInvalidMessageStyle(verification.passwordConstraints, password);
195+
}, [verification.passwordConstraints, password]);
196+
191197
return (
192198
<>
193199
<div className={styles.signUpContainer}>
194200
{isAlertShow && (
195-
<div className={styles.alertContainer}>
196-
<Alert
197-
buttonTitle="확인"
198-
message={alertMessage}
199-
onClick={handleAlertButtonClick}
200-
></Alert>
201-
</div>
201+
<Alert buttonTitle="확인" message={alertMessage} onClick={handleAlertButtonClick}></Alert>
202202
)}
203203
<div className={styles.signUpForm}>
204204
<div>
@@ -257,7 +257,7 @@ export default function SignUp() {
257257
/>
258258
<br />
259259
<span
260-
className={resolveInvalidMessageStyle(verification.passwordConstraints, password)}
260+
className={resolvedPasswordInvalidStyle}
261261
>
262262
비밀번호는 특수부호를 포함 8자이상 작성해주세요
263263
</span>

frontend/src/pages/signup/SignUp.module.css

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@
55
margin: 0 auto;
66
}
77

8-
.alertContainer {
9-
position: absolute;
10-
top: 60%;
11-
left: 50%;
12-
transform: translate(-50%, -50%);
13-
width: 300px;
14-
min-height: 210px;
15-
}
16-
178
.signUpForm {
189
min-width: 390px;
1910
display: flex;
@@ -68,6 +59,7 @@
6859
background-color: #c8c8c8 !important; /* ✅ 강제 적용 */
6960
cursor: not-allowed;
7061
color: gray;
62+
padding-left: 3%;
7163
}
7264

7365
.fieldsInput::placeholder {

frontend/src/pages/time-paper-create/TimePaperCreate.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,11 @@ export default function TimePaperCreate() {
9898
<form>
9999
<div className={styles.container}>
100100
{isError && (
101-
<div className={styles.alertContainer}>
102101
<Alert
103102
buttonTitle={'확인'}
104103
message={errorMessage}
105104
onClick={handleAlertButtonClick}
106105
></Alert>
107-
</div>
108106
)}
109107
<div className={styles.inputContainer}>
110108
<UnderBarInput

0 commit comments

Comments
 (0)