-
Notifications
You must be signed in to change notification settings - Fork 1
✨ feat: RegisterLayout 컴포넌트 구현 #118
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d3f654a
✨ feat: RegisterLayout 컴포넌트 구현
Yun-Jinwoo a4266dc
✨ feat: 등록한 공고가 없는 경우와 지원 내역이 없는 경우 추가
Yun-Jinwoo 0f02b70
🎨 style: 아래 padding 수정
Yun-Jinwoo ac86ad2
♻️ refactor: 헤더 삭제, 박스 부분만 담당
Yun-Jinwoo cc88418
🎨 style: 버튼 사이즈 프롭으로 크기 조정
Yun-Jinwoo 1c1a951
Merge branch 'develop' of https://github.com/codeit-6team/The-julge i…
Yun-Jinwoo 53c6823
🎨 style: 버튼 사이즈 프롭으로 크기 조정
Yun-Jinwoo 4a0dcec
✨ feat: 버튼 크기 타입 지정
Yun-Jinwoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import Button from '../common/Button'; | ||
|
|
||
| const TEXT_MAP = { | ||
| profile: { | ||
| header: '내 프로필', | ||
| content: '내 프로필을 등록하고 원하는 가게에 지원해 보세요.', | ||
| buttonText: '내 프로필 등록하기', | ||
| link: '/profile/edit', | ||
| }, | ||
| store: { | ||
| header: '내 가게', | ||
| content: '내 가게를 소개하고 공고도 등록해 보세요.', | ||
| buttonText: '가게 등록하기', | ||
| link: '/owner/store/edit', | ||
| }, | ||
| application: { | ||
| header: '신청 내역', | ||
| content: '아직 신청 내역이 없어요.', | ||
| buttonText: '공고 보러가기', | ||
| link: '/', | ||
| }, | ||
| notice: { | ||
| header: '등록한 공고', | ||
| content: '공고를 등록해 보세요.', | ||
| buttonText: '공고 등록하기', | ||
| link: '/owner/post', | ||
| }, | ||
| }; | ||
|
|
||
| export default function RegisterLayout({ | ||
| type, | ||
| }: { | ||
| type: 'profile' | 'store' | 'application' | 'notice'; | ||
| }) { | ||
| const navigate = useNavigate(); | ||
| const { header, content, buttonText, link } = TEXT_MAP[type]; | ||
|
|
||
| return ( | ||
| <div className="mx-12 flex flex-col gap-16 pt-40 pb-80 md:mx-32 md:gap-24 md:pt-60 md:pb-120 lg:mx-auto lg:w-964"> | ||
| <h1 className="text-h3 font-bold md:text-h1">{header}</h1> | ||
Moon-ju-young marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <div className="flex flex-col items-center gap-16 rounded-[12px] border border-gray-20 px-24 py-60 md:gap-24"> | ||
| <p className="text-body2/22 md:text-body1/26">{content}</p> | ||
| <Button | ||
| size="medium" | ||
| className="px-20 py-10 md:h-48 md:w-344 md:text-body1 md:font-bold" | ||
| onClick={() => navigate(link)} | ||
| > | ||
| {buttonText} | ||
| </Button> | ||
Yun-Jinwoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💬 type에 따라 구분하는 방식이 아니라 prop으로 넘겨주는 방식이면 더 좋을 것 같습니다~
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.
음 이미 다 정해져있는 텍스트들이고, prop으로 넘겨주는 방식이면 사용할때 괜히 더 길어지는 것 같아 이 방식을 채택했습니다
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.
말씀대로 확장성을 고려한다면 주영님 말씀이 맞지만, 지금 저희가 구현하는 페이지 내에서 사용되는 부분은 4개뿐이고, 사용처가 추가되거나 내용이 변할 가능성이 없다고 느끼기 때문에 현재는 이 방식이 좀 더 적합하다고 생각합니다.
추후에 확장 가능성이 있다면 prop으로 넘기는 방식도 괜찮을 것 같습니다.