Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
44f9c51
design: 편지 게시판 페이지 내 편지 미리보기 컴포넌트 퍼블리싱
AAminha Feb 18, 2025
9719b6e
design: 롤링페이퍼 공지 컴포넌트 퍼블리싱
AAminha Feb 18, 2025
7847831
design: 편지 공유 게시판 퍼블리싱
AAminha Feb 18, 2025
45dd693
refactor: ConfirmModal 배경 이미지 삽입 방식 개선
AAminha Feb 18, 2025
7a2351c
rename: 파일명 형식 통일을 위한 에셋 파일명 수정
AAminha Feb 18, 2025
9b259a1
design: 롤링페이퍼 편지 컴포넌트 퍼블리싱
AAminha Feb 18, 2025
ecf4344
design: 롤링페이퍼 페이지 퍼블리싱
AAminha Feb 18, 2025
aad7fb9
refactor: ModalOverlay 컴포넌트로 모달의 외부 영역 클릭 로직 이동
AAminha Feb 18, 2025
a7bb63a
design: 롤링페이퍼 페이지 메시지 상세조회 모달 퍼블리싱
AAminha Feb 18, 2025
306ff32
design: 모달 활성화 시, 스크롤이 안되도록 수정
AAminha Feb 19, 2025
bdc90ee
design: 신고 모달 컴포넌트 퍼블리싱
AAminha Feb 19, 2025
3ae6213
design: 롤링페이퍼 메사지 추가 모달 버픕ㄹ리싱
AAminha Feb 19, 2025
db6ef4f
design: Header 컴포넌트 position을 fixed로 변경
AAminha Feb 19, 2025
7988034
refactor: 하단 배경 컴포넌트로 분리
AAminha Feb 19, 2025
fe85339
design: 마이페이지 중 내가 올린 게시물 페이지 퍼블리싱
AAminha Feb 19, 2025
1271579
design: 게시판 상세 페이지의 편지 컴포넌트 퍼블리싱
AAminha Feb 19, 2025
b80300f
design: 편지 공유 게시글 상세 페이지 퍼블리싱
AAminha Feb 19, 2025
32c9d0d
feat: 게시글 상세 페이지 헤더 컴포넌트 뒤로가기 기능 추가
AAminha Feb 19, 2025
2d63bb9
remove: 중복 에셋 제거
AAminha Feb 19, 2025
5e4c124
refactor: 중복 스타일 코드 utilities로 분리
AAminha Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@egjs/react-infinitegrid": "^4.12.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요것이 masonry 라이브러리인가용?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇습니당~~~~!!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금은 내용이 똑같아서 뭔 차이지? 싶으시겠지만 길이가 다양해지면 보여질겁니다 흐흐흐

"@mui/icons-material": "^6.4.4",
"@tailwindcss/vite": "^4.0.6",
"@tanstack/react-query": "^5.66.0",
Expand Down
69 changes: 69 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ const App = () => {
<Route path=":id" element={<LetterDetailPage />} />
</Route>
<Route path="board">
<Route path="letter" element={<LetterBoardPage />} />
<Route element={<Layout />}>
<Route path="rolling/:id" element={<RollingPaperPage />} />
<Route path="letter" element={<LetterBoardPage />} />
</Route>
<Route path="letter/:id" element={<LetterBoardDetailPage />} />
<Route path="rolling/:id" element={<RollingPaperPage />} />
</Route>
<Route path="mypage" element={<Layout />}>
<Route index element={<MyPage />} />
<Route path="board" element={<LetterBoardPage />} />
<Route path="notifications" element={<NotificationsPage />} />
</Route>
</Route>
Expand Down
Empty file removed src/assets/.gitkeep
Empty file.
8 changes: 8 additions & 0 deletions src/assets/icons/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions src/assets/icons/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
import AlarmIcon from './alarm.svg?react';
import ArrowLeftIcon from './arrow-left.svg?react';
import BoardIcon from './board.svg?react';
import DeleteIcon from './delete.svg?react';
import EnvelopeIcon from './envelope.svg?react';
import LikeFilledIcon from './like-filled.svg?react';
import LikeOutlinedIcon from './like-outlined.svg?react';
import NoticeIcon from './notice.svg?react';
import PersonIcon from './person.svg?react';
import SirenIcon from './siren.svg?react';
import SirenFilledIcon from './siren-filled.svg?react';
import SirenOutlinedIcon from './siren-outlined.svg?react';

export { AlarmIcon, PersonIcon, ArrowLeftIcon, SirenIcon, EnvelopeIcon, BoardIcon };
export {
AlarmIcon,
PersonIcon,
ArrowLeftIcon,
SirenFilledIcon,
SirenOutlinedIcon,
EnvelopeIcon,
BoardIcon,
NoticeIcon,
LikeFilledIcon,
LikeOutlinedIcon,
DeleteIcon,
};
8 changes: 8 additions & 0 deletions src/assets/icons/like-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/icons/like-outlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/icons/notice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
8 changes: 8 additions & 0 deletions src/assets/icons/siren-outlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/field-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/memo-pink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/memo-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/modal-pink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/components/BackgroundBottom.tsx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

공용 언덕 컴포넌트✅

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import BgItem from '@/assets/images/field-4.png';

const BackgroundBottom = () => {
return (
<div
className="background-image-filled fixed bottom-[-40px] left-1/2 z-[-10] h-42 w-full -translate-x-1/2 opacity-70"
style={{ '--bg-image': `url(${BgItem})` } as React.CSSProperties}
/>
);
};

export default BackgroundBottom;
11 changes: 8 additions & 3 deletions src/components/ConfirmModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ModalBg from '@/assets/images/yellow-modal.png';
import ModalBg from '@/assets/images/modal-yellow.png';

import ModalOverlay from './ModalOverlay';

Expand All @@ -7,6 +7,7 @@ interface ConfirmModalProps {
description: string;
cancelText: string;
confirmText: string;
confirmDisabled?: boolean;
children?: React.ReactNode;
onCancel: () => void;
onConfirm: () => void;
Expand All @@ -17,6 +18,7 @@ const ConfirmModal = ({
description,
cancelText,
confirmText,
confirmDisabled,
children,
onCancel,
onConfirm,
Expand All @@ -25,8 +27,10 @@ const ConfirmModal = ({
return (
<ModalOverlay>
<div className="w-73">
<section className="relative mb-12 overflow-hidden rounded-lg p-5">
<img src={ModalBg} className="absolute inset-0 z-[-10] h-full w-full" />
<section
className="background-image-filled mb-12 rounded-lg p-5"
style={{ '--bg-image': `url(${ModalBg})` } as React.CSSProperties}
>
<div className="flex flex-col gap-1">
<p className="body-m text-gray-80">{title}</p>
<p className="caption-r text-black">{description}</p>
Expand All @@ -44,6 +48,7 @@ const ConfirmModal = ({
<button
type="button"
className="primary-btn body-m h-10 flex-1 basis-1/2"
disabled={confirmDisabled}
onClick={onConfirm}
>
{confirmText}
Expand Down
66 changes: 66 additions & 0 deletions src/components/MessageModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { ChangeEvent } from 'react';

import ModalBg from '@/assets/images/modal-pink.png';

import ModalOverlay from './ModalOverlay';
import TextareaField from './TextareaField';

interface MessageModalProps {
description?: string;
inputValue: string;
placeholder?: string;
cancelText: string;
completeText: string;
children?: React.ReactNode;
onInputChange: (e: ChangeEvent<HTMLTextAreaElement>) => void;
onCancel: () => void;
onComplete: () => void;
}

const MessageModal = ({
description,
inputValue,
placeholder,
cancelText,
completeText,
children,
onInputChange,
onCancel,
onComplete,
}: MessageModalProps) => {
return (
<ModalOverlay>
<p className="body-sb mb-4 text-white">{description}</p>
<section
className="background-image-filled mb-12 w-78 rounded-lg p-4"
style={{ '--bg-image': `url(${ModalBg})` } as React.CSSProperties}
>
<TextareaField
rows={5}
value={inputValue}
placeholder={placeholder}
onChange={onInputChange}
/>
{children}
</section>
<section className="flex items-center gap-6">
<button
type="button"
className="body-m secondary-btn h-10 flex-1 basis-1/2"
onClick={onCancel}
>
{cancelText}
</button>
<button
type="button"
className="primary-btn body-m h-10 flex-1 basis-1/2"
onClick={onComplete}
>
{completeText}
</button>
</section>
</ModalOverlay>
);
};

export default MessageModal;
41 changes: 37 additions & 4 deletions src/components/ModalOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
import { useEffect } from 'react';

import { getScrollbarWidth } from '@/utils/getScrollbarWidth';

interface ModalOverlayProps {
children: React.ReactElement;
closeOnOutsideClick?: boolean;
children: React.ReactNode;
onClose?: () => void;
}

const ModalOverlay = ({ children }: ModalOverlayProps) => {
const ModalOverlay = ({ closeOnOutsideClick = false, children, onClose }: ModalOverlayProps) => {
useEffect(() => {
const scrollbarWidth = getScrollbarWidth();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 useEffect문 혹시 스크롤바 없는 페이지에 스크롤바 넓이 만큼 body 넓이 값을 붙여주는건가용?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

맞아요! 정확히는 지금 모든 페이지에 스크롤바가 존재하도록 설정해두었는데요
유일하게 모달이 열릴때 스크롤바가 사라져서 그걸 커버하기 위함입니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와우 이거 다른 프로젝트에서도 필요했던건데 꿀팁 배워갑니다!!!!


document.documentElement.style.setProperty('--scrollbar-width', `${scrollbarWidth}px`);
document.body.classList.add('modal-open');

return () => {
document.documentElement.style.setProperty('--scrollbar-width', '0px');
document.body.classList.remove('modal-open');
};
}, []);

const handleClickOutside = () => {
if (closeOnOutsideClick && onClose) {
onClose();
}
};

const handleClickInside = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation();
};

return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60">
{children}
<div
className="fixed inset-0 z-50 flex items-center justify-center bg-black/60"
onClick={handleClickOutside}
>
<div className="flex flex-col" onClick={handleClickInside}>
{children}
</div>
</div>
);
};
Expand Down
26 changes: 26 additions & 0 deletions src/components/NoticeRolling.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Link } from 'react-router';
import { twMerge } from 'tailwind-merge';

import { NoticeIcon } from '@/assets/icons';

const DUMMY_CONTENT =
'11월 15일은 수능! 고생하는 수험생들을 위해 응원의 11월 15일은 수능! 고생하는 수험 11월 15일은 수능! 고생하는 수험';

const NoticeRolling = () => {
return (
<Link to="/board/rolling/1">
<article
className={twMerge(
'text-gray-60 flex w-full items-center gap-2.5 rounded-lg px-4 py-2',
'bg-linear-[275deg,rgba(255,255,255,0.4)_13.74%,rgba(238,238,238,0.4)_67.61%]',
'shadow-[0_1px_6px_rgba(218,189,74,0.8)]',
)}
>
<NoticeIcon className="h-6 w-6 text-gray-50" />
<p className="body-sb line-clamp-1">{DUMMY_CONTENT}</p>
</article>
</Link>
);
};

export default NoticeRolling;
Loading