-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FEAT-8] 헤더 세부 기능 구현 #20
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8df583f
✨ feat(custom): 닫기 아이콘, 햄버거 메뉴 아이콘 추가
qwer0114 2293418
💄 style(custom): chip 컴포넌트 max-h 적용
qwer0114 630f1c4
✨ feat(custom): 헤더의 바텀시트 하단 전화번호 부 컴포넌트 구현
qwer0114 dc280e0
✨ feat(custom): presetButton 컴포넌트 selected 상태 추가
qwer0114 4aaecde
✨ feat(custom): 헤더 바텀시트 중단 전형 별 바로가기 링크 탭 추가
qwer0114 c1dfd95
✨ feat(custom): 전형 별 질문에 대한 Chip 상태 메시지 상수 정의
qwer0114 7cce19b
✨ feat(custom): 전형 별 바로가기 링크 상수 정의
qwer0114 c2ebeb3
✨ feat(custom): header 햄버거 메뉴 바텀시트 기능 구현
qwer0114 f50a098
♻️ refactor(custom): 컴포넌트 가독성을 높이기 위해 내부 컴포넌트로 분리
qwer0114 064c0a2
♻️ refactor(custom): 관심사 응집도를 위한 폴더 구조 변경
qwer0114 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
This file contains 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,34 @@ | ||
import { useState } from 'react'; | ||
import PresetButton from '@/components/preset-button/preset-button'; | ||
import ADMISSION_QUICK_LINK from '@/constants/admission-quick-link'; | ||
import { AdmissionType } from '@/types/admission-type'; | ||
import { ADDMISSION } from '@/types/admission-type'; | ||
|
||
function AdmissionQuickLinkTabs({ initialAdmissionType }: { initialAdmissionType: AdmissionType | null }) { | ||
const [selectedAdmissionType, setSelectedAdmissionType] = useState(initialAdmissionType ?? 'SUSI'); | ||
|
||
return ( | ||
<div> | ||
<div className="flex gap-2"> | ||
{Object.entries(ADDMISSION).map(([type, label]) => ( | ||
<PresetButton | ||
key={type} | ||
selected={type === selectedAdmissionType} | ||
onClick={() => setSelectedAdmissionType(type as AdmissionType)} | ||
> | ||
{label} | ||
</PresetButton> | ||
))} | ||
</div> | ||
<div className="mt-6 flex flex-col gap-6 text-headline"> | ||
{ADMISSION_QUICK_LINK[selectedAdmissionType].map((link) => ( | ||
<a key={link.id} className="cursor-pointer" href={link.link} target="_blank"> | ||
{link.label} | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default AdmissionQuickLinkTabs; |
This file contains 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,33 @@ | ||
interface ContactItemProps { | ||
title: string; | ||
department: string; | ||
numbers: number[]; | ||
} | ||
function ContactItem({ title, department, numbers }: ContactItemProps) { | ||
return ( | ||
<div className="flex text-label text-gray-500"> | ||
<span className="w-1/2">{title}</span> | ||
<span className="flex-1 whitespace-nowrap"> | ||
{department} :{' '} | ||
<a href={`tel:02-300-${numbers[0]}`} className="underline underline-offset-4"> | ||
02)300-{numbers[0]} | ||
</a> | ||
,{' '} | ||
<a href={`tel:02-300-${numbers[1]}`} className="underline underline-offset-4"> | ||
{numbers[1]} | ||
</a> | ||
</span> | ||
</div> | ||
); | ||
} | ||
|
||
function Contact() { | ||
return ( | ||
<div className="flex flex-col gap-3"> | ||
<ContactItem title="학생부교과, 실기/실적 위주 문의" department="입학관리팀" numbers={[1799, 1800]} /> | ||
<ContactItem title="학생부종합 문의" department="인재발굴팀" numbers={[1794, 1844]} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Contact; |
This file contains 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
This file contains 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
This file contains 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,43 @@ | ||
const ADMISSION_QUICK_LINK = { | ||
SUSI: [ | ||
{ | ||
id: 'faq', | ||
label: '수시 FAQ 바로가기', | ||
link: 'https://iphak.mju.ac.kr/pages/?p=33&b=B_1_5&cate=%EC%88%98%EC%8B%9C', | ||
}, | ||
{ | ||
id: 'results', | ||
label: '수시 입시결과 바로가기', | ||
link: 'https://iphak.mju.ac.kr/pages/?p=11&b=B_1_2&cate=%EC%88%98%EC%8B%9C', | ||
}, | ||
{ id: 'guide', label: '수시 모집요강 바로가기', link: 'https://iphak.mju.ac.kr/pages/?p=10&mj=01' }, | ||
], | ||
JEONGSI: [ | ||
{ | ||
id: 'faq', | ||
label: '정시 FAQ 바로가기', | ||
link: 'https://iphak.mju.ac.kr/pages/?p=33&b=B_1_5&cate=%EC%A0%95%EC%8B%9C', | ||
}, | ||
{ | ||
id: 'results', | ||
label: '정시 입시결과 바로가기', | ||
link: 'https://iphak.mju.ac.kr/pages/?p=17&b=B_1_2&cate=%EC%A0%95%EC%8B%9C', | ||
}, | ||
{ id: 'guide', label: '정시 모집요강 바로가기', link: 'https://iphak.mju.ac.kr/pages/?p=16&mj=02' }, | ||
], | ||
PYEONIP: [ | ||
{ | ||
id: 'faq', | ||
label: '편입 FAQ 바로가기', | ||
link: 'https://iphak.mju.ac.kr/pages/?p=33&b=B_1_5&cate=%ED%8E%B8%EC%9E%85%ED%95%99', | ||
}, | ||
{ | ||
id: 'results', | ||
label: '편입 입시결과 바로가기', | ||
link: 'https://iphak.mju.ac.kr/pages/?p=27&b=B_1_2&cate=%ED%8E%B8%EC%9E%85%ED%95%99', | ||
}, | ||
{ id: 'guide', label: '편입 모집요강 바로가기', link: 'https://iphak.mju.ac.kr/pages/?p=26&mj=04' }, | ||
], | ||
}; | ||
|
||
export default ADMISSION_QUICK_LINK; |
This file contains 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,7 @@ | ||
const CHIP_LABEL = { | ||
SUSI: '수시 질문중', | ||
JEONGSI: '정시 질문중', | ||
PYEONIP: '편입 질문중', | ||
}; | ||
|
||
export default CHIP_LABEL; |
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.
진짜 사소한거긴한데 저는 해당 경우에 아래 방법처럼 기본값을 주는 방법을 선호하거든요...! 혹시 해당 방법에 대해서는 어떻게 생각하시나요?
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.
좋은 의견 감사합니다! 다만 제안해주신 개선 방안이 기존 코드를 완벽히 대체 하지 못할 거 같아요 ㅠㅠ..
이유는 다음과 같습니다!
initialAdmissionType
은null
값을 허용해야만 하는 상황입니다(사용자가 선택하기 전admissionType
전역상태에서null
값으로 초기화),이 상황에서 매개변수 기본값 (="SUSI")는 예상대로 작동하지 않습니다.
만약 제안해주신 방법을 사용하기 위해서는 부모 컴포넌트에서
AdmissionQuickLinkTabs
컴포넌트에서 props를 전달할 때null
값일 시 props를 전달하지 않는 방법으로 수정할 수 있을거 같지만 개인적으로 해당 방법보다 기존 방법이 괜찮을거 같은데 어떻게 생각하시나용??아니면 혹시 제가 제안 주신 부분을 잘못 이해하고 있다면 다시 한번 설명해주시면 감사하겠습니다 😢
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.
그러네요...! 너무 단순히 보이는 부분만 생각해서 말씀드린 것 같습니다! 기존 방법이 괜찮을 것 같네요!