-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/onboarding #30
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
Feat/onboarding #30
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7b33c37
update: token
dasosann 40e37f7
Merge branch 'main' into feat/onboarding
dasosann 7a950e7
feat: Introduce a design token system and add the initial StartOnBoar…
dasosann 343fb60
feat: Add `StartOnBoarding` component to display an animated welcome …
dasosann 2a7af15
fix: 자체로그인 nextjs에서 인터셉트로 로그인 리다이렉트 및 쿠키설정
dasosann 29410f6
feat: 드롭다운 Input 컴포넌트
dasosann 710dae0
fix: 패스워드 로직 수정
dasosann 069be3a
feat: 검증 에러 처리 로직 추가
dasosann a05a6fa
feat: 코드리뷰 반영이염
dasosann 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
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
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
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
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
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
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,103 @@ | ||
| import React from "react"; | ||
| import { cn } from "@/lib/utils"; | ||
| import { ChevronDown } from "lucide-react"; | ||
|
|
||
| // 옵션 타입 정의 (일반적인 단일 옵션) | ||
| export type SelectOption = { | ||
| value: string; | ||
| label: string; | ||
| }; | ||
|
|
||
| // 옵션 그룹 타입 정의 (대학 - 계열 - 학과 처럼 묶여있는 경우) | ||
| export type SelectOptionGroup = { | ||
| label: string; | ||
| options: SelectOption[]; | ||
| }; | ||
|
|
||
| interface FormSelectProps extends Omit< | ||
| React.SelectHTMLAttributes<HTMLSelectElement>, | ||
| "id" | "name" | ||
| > { | ||
| id: string; | ||
| name: string; | ||
| options: (SelectOption | SelectOptionGroup)[]; | ||
| placeholder?: string; | ||
| error?: boolean; | ||
| } | ||
|
|
||
| const SELECT_CONTAINER_STYLE = { | ||
| background: | ||
| "linear-gradient(180deg, rgba(248, 248, 248, 0.03) 0%, rgba(248, 248, 248, 0.24) 100%)", | ||
| }; | ||
|
|
||
| const SELECT_CLASSNAME = | ||
| "all:unset box-border w-full border-b border-gray-300 px-2 py-[14.5px] pr-8 leading-[19px] typo-16-500 text-color-gray-900 outline-none appearance-none cursor-pointer"; | ||
|
|
||
| // 타입 가드: 옵션 그룹인지 확인 | ||
| function isOptionGroup( | ||
| option: SelectOption | SelectOptionGroup, | ||
| ): option is SelectOptionGroup { | ||
| return "options" in option; | ||
| } | ||
|
|
||
| const FormSelect = ({ | ||
| id, | ||
| name, | ||
| options, | ||
| placeholder, | ||
| className = "", | ||
| style = {}, | ||
| error = false, | ||
| ...rest | ||
| }: FormSelectProps) => { | ||
| return ( | ||
| <div className="relative w-full"> | ||
| <select | ||
| id={id} | ||
| name={name} | ||
| className={cn( | ||
| SELECT_CLASSNAME, | ||
| error && "border-color-flame-500", | ||
| !rest.value && "text-color-text-caption2", // placeholder 색상 처리 | ||
| className, | ||
| )} | ||
| style={{ ...SELECT_CONTAINER_STYLE, ...style }} | ||
| defaultValue={rest.value === undefined ? "" : undefined} | ||
| {...rest} | ||
| > | ||
| {placeholder && ( | ||
| <option value="" disabled hidden> | ||
| {placeholder} | ||
| </option> | ||
| )} | ||
|
|
||
| {options.map((item, index) => { | ||
| if (isOptionGroup(item)) { | ||
| return ( | ||
| <optgroup key={`${item.label}-${index}`} label={item.label}> | ||
| {item.options.map((opt) => ( | ||
| <option key={opt.value} value={opt.value}> | ||
| {opt.label} | ||
| </option> | ||
| ))} | ||
| </optgroup> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <option key={item.value} value={item.value}> | ||
| {item.label} | ||
| </option> | ||
| ); | ||
| })} | ||
| </select> | ||
|
|
||
| {/* 오른쪽에 화살표 아이콘 (포인터 이벤트 무시하여 클릭 방해 안 함) */} | ||
| <div className="pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-gray-400"> | ||
| <ChevronDown size={20} /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default FormSelect; | ||
dasosann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.