Skip to content

Commit fc05bf2

Browse files
committed
2 parents 5aa5ec4 + 90989f8 commit fc05bf2

14 files changed

Lines changed: 456 additions & 235 deletions

File tree

public/images/char.3.png

628 KB
Loading

public/images/char3.png

-141 KB
Binary file not shown.

src/features/emotion/pages/EmotionPage.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
.back-button {
2828
width: 32px;
2929
height: 24px;
30-
background: transparent;
30+
3131
border-radius: 12px;
3232
display: flex;
3333
align-items: center;
@@ -553,3 +553,20 @@
553553
margin-right: auto;
554554
}
555555
}
556+
557+
/* EmotionPage: 전역 back-button 규칙 무력화 */
558+
.emotion-header .back-button {
559+
position: static !important;
560+
top: auto !important;
561+
left: auto !important;
562+
transform: none !important;
563+
564+
display: inline-flex;
565+
align-items: center;
566+
justify-content: center;
567+
margin-right: 8px;
568+
vertical-align: top;
569+
}
570+
.greeting-text {
571+
display: inline-block; /* 텍스트 바로 왼쪽 붙이기 */
572+
}

src/features/emotion/pages/EmotionPage.jsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -538,24 +538,25 @@ const EmotionPage = () => {
538538
<div className="emotion-container">
539539
{/* 헤더 */}
540540
<div className="emotion-header fade-in">
541-
<button className="back-button" onClick={() => navigate("/main")}>
542-
<svg
543-
width="24"
544-
height="24"
545-
viewBox="0 0 24 24"
546-
fill="none"
547-
xmlns="http://www.w3.org/2000/svg"
548-
>
549-
<path
550-
d="M15 18L9 12L15 6"
551-
stroke="currentColor"
552-
strokeWidth="2"
553-
strokeLinecap="round"
554-
strokeLinejoin="round"
555-
/>
556-
</svg>
557-
</button>
558541
<div className="header-greeting">
542+
<button className="back-button" onClick={() => navigate("/main")}>
543+
<svg
544+
width="24"
545+
height="24"
546+
marginRight="10"
547+
viewBox="0 0 24 24"
548+
fill="none"
549+
xmlns="http://www.w3.org/2000/svg"
550+
>
551+
<path
552+
d="M15 18L9 12L15 6"
553+
stroke="currentColor"
554+
strokeWidth="2"
555+
strokeLinecap="round"
556+
strokeLinejoin="round"
557+
/>
558+
</svg>
559+
</button>{" "}
559560
<div className="greeting-text">
560561
{nickname}님,
561562
<br />

src/features/mission/pages/MissionMainPage.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ body {
7070
color: rgba(168, 177, 170, 1);
7171
margin: 0;
7272
padding: 2px;
73+
font-size: clamp(18px, 2vw, 20px);
7374
}
7475
/* 잠금 해제(완료 반영) 상태일 때 p를 연두색으로 */
7576
.reward.unlocked p {
@@ -102,14 +103,14 @@ body {
102103
margin-top: 15px;
103104
}
104105
.mission-card p {
105-
margin-bottom: 15px;
106-
font-size: 14px;
106+
margin: 0 0 15px 0;
107+
font-size: clamp(14px, 2vw, 15px);
107108
color: #333;
108109
}
109110
.mission-card button {
110111
width: 100%;
111112
padding: 5px;
112-
113+
height: clamp(25px, 2vw, 30px);
113114
align-items: center;
114115
background: rgba(64, 234, 135, 1);
115116
border: none;
@@ -381,9 +382,10 @@ body {
381382
.modal-header {
382383
position: relative;
383384
padding: 14px 18px;
384-
font-weight: 800;
385+
font-weight: 500;
385386
color: #2f3a34;
386387
border-bottom: 1px solid #f0f5f2;
388+
font-size: clamp(14px, 10vw, 17px);
387389
}
388390

389391
.modal-close {
@@ -406,13 +408,14 @@ body {
406408
.modal-body {
407409
padding: 18px;
408410
color: #2f3a34;
409-
font-size: 14px;
411+
font-size: clamp(16px, 2vw, 18px);
410412
line-height: 1.6;
411413
}
412414

413415
.modal-title {
414416
font-weight: 700;
415417
color: rgba(65, 96, 76, 1);
418+
font-size: clamp(12px, 10vw, 20px);
416419
}
417420

418421
.modal-actions {

src/features/mission/pages/MissionMainPage.jsx

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ const MissionMainPage = () => {
5454
return "/images/missionUnchecked.png";
5555
};
5656

57+
// ===== 업로드 개수 제한 상수 =====
58+
const MAX_PHOTOS = 3;
59+
5760
// ===== 최초 로드: 주간(로드맵) + 오늘의 데일리 =====
5861
useEffect(() => {
5962
(async () => {
@@ -95,23 +98,41 @@ const MissionMainPage = () => {
9598
setFeedbackById((prev) => ({ ...prev, [id]: value }));
9699
};
97100

101+
// ✅ 업로드 처리(최대 3장 유지)
98102
const handlePhotoChange = (id, e) => {
99103
const files = Array.from(e.target.files || []);
100104
if (files.length === 0) return;
101105

102106
const prevFiles = photoById[id] || [];
103107
const prevUrls = photoPreviewById[id] || [];
104108

109+
const remaining = MAX_PHOTOS - prevFiles.length;
110+
if (remaining <= 0) {
111+
alert(`사진은 최대 ${MAX_PHOTOS}장까지 업로드할 수 있어요.`);
112+
e.target.value = "";
113+
return;
114+
}
115+
116+
// 남은 칸만큼만 받기
117+
const incoming = files.slice(0, remaining);
118+
105119
const nextFiles = [...prevFiles];
106120
const nextUrls = [...prevUrls];
107121

108-
files.forEach((f) => {
122+
incoming.forEach((f) => {
109123
nextFiles.push(f);
110124
nextUrls.push(URL.createObjectURL(f));
111125
});
112126

113127
setPhotoById((prev) => ({ ...prev, [id]: nextFiles }));
114128
setPhotoPreviewById((prev) => ({ ...prev, [id]: nextUrls }));
129+
130+
// 남는 파일이 있었으면 안내
131+
if (files.length > remaining) {
132+
alert(
133+
`사진은 최대 ${MAX_PHOTOS}장까지 업로드할 수 있어요. (초과분은 제외됐어요)`
134+
);
135+
}
115136
e.target.value = "";
116137
};
117138

@@ -333,7 +354,7 @@ const MissionMainPage = () => {
333354
<textarea
334355
className="feedback-textarea"
335356
rows={5}
336-
placeholder="간단한 후기(5자 이상)와 사진을 업로드해주세요!"
357+
placeholder="간단한 후기(5자 이상)와 사진(1~3장)을 업로드해주세요!"
337358
value={feedbackById[m.id] || ""}
338359
onChange={(e) => handleTextChange(m.id, e.target.value)}
339360
/>
@@ -348,14 +369,28 @@ const MissionMainPage = () => {
348369
style={{ display: "none" }}
349370
onChange={(e) => handlePhotoChange(m.id, e)}
350371
/>
372+
{/* ✅ 라벨 기본 동작만 사용 + onMouseDown으로 사전 검사/차단 */}
351373
<label
352374
htmlFor={`file-${m.id}`}
353375
className="upload-btn"
354376
title="사진 업로드"
377+
onMouseDown={(e) => {
378+
const count = photoById[m.id]?.length || 0;
379+
if (count >= MAX_PHOTOS) {
380+
e.preventDefault(); // 파일창 열림 자체를 막음
381+
alert(
382+
`사진은 최대 ${MAX_PHOTOS}장까지 업로드할 수 있어요. 기존 사진을 삭제해 주세요.`
383+
);
384+
}
385+
}}
355386
>
356387
<img src="/images/imageUpload.png" alt="upload" />
357388
</label>
358389

390+
<span className="upload-counter">
391+
{photoById[m.id]?.length || 0} / {MAX_PHOTOS}
392+
</span>
393+
359394
<div className="preview-list">
360395
{previews.map((url, idx) => (
361396
<div key={`${url}-${idx}`} className="thumb">
@@ -445,6 +480,8 @@ const MissionMainPage = () => {
445480
<div>
446481
<span className="modal-title">{roadmapToConfirm.title}</span>
447482
<br /> 후기 작성을 완료하셨나요?
483+
<br />
484+
추후 관리자 승인을 통해 포인트가 지급됩니다.
448485
</div>
449486
</div>
450487
<div className="modal-actions">

0 commit comments

Comments
 (0)