-
Notifications
You must be signed in to change notification settings - Fork 2
design: 게시판 퍼블리싱 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
design: 게시판 퍼블리싱 #14
Changes from all commits
44f9c51
9719b6e
7847831
45dd693
7a2351c
9b259a1
ecf4344
aad7fb9
a7bb63a
306ff32
bdc90ee
3ae6213
db6ef4f
7988034
fe85339
1271579
b80300f
32c9d0d
2d63bb9
5e4c124
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| 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, | ||
| }; |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; |
| 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; |
| 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(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 useEffect문 혹시 스크롤바 없는 페이지에 스크롤바 넓이 만큼 body 넓이 값을 붙여주는건가용?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 맞아요! 정확히는 지금 모든 페이지에 스크롤바가 존재하도록 설정해두었는데요
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
| ); | ||
| }; | ||
|
|
||
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요것이 masonry 라이브러리인가용?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그렇습니당~~~~!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금은 내용이 똑같아서 뭔 차이지? 싶으시겠지만 길이가 다양해지면 보여질겁니다 흐흐흐