-
Notifications
You must be signed in to change notification settings - Fork 69
[클린코드 리액트 3기 정진범] 페이먼츠 미션 Step3 #159
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
Open
jungjinbeom
wants to merge
39
commits into
next-step:jungjinbeom
Choose a base branch
from
jungjinbeom:main
base: jungjinbeom
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
9ff4c10
vite 환경 설정
jungjinbeom 5f29bb5
classnames 라이브러리 추가
jungjinbeom 0924b64
PageTitle 문구 삭제
jungjinbeom 122daa2
사용하지 않는 파일 삭제
jungjinbeom 4cd3623
라우트 Context 컴포넌트 생성
jungjinbeom 3295a14
사용하지 않는 파일 수정
jungjinbeom aedfe7d
카드리스트, 카드 완료 페이지 개발중
jungjinbeom d79e9d8
Button, Input, Card 스토리북 추가
jungjinbeom b7bc9ca
태그 구조 수정
jungjinbeom b12a25e
모달 컴포넌트 추가
jungjinbeom b64ca45
Merge remote-tracking branch 'upstream/jungjinbeom'
jungjinbeom cb3f051
중복 파일삭제
jungjinbeom b4dc5cf
lint 체크
jungjinbeom 1c54168
툴팁 컴포넌트 개발
jungjinbeom 68eb150
스토리북 추가
jungjinbeom 5bae1a9
CardContext와 ListContext 통합
jungjinbeom db1c4d2
Merge remote-tracking branch 'upstream/jungjinbeom'
jungjinbeom 2655062
eslint 적용
jungjinbeom 2e1c2a2
스토리북 추가
jungjinbeom 2b699a8
사용하지 않는 상수 삭제
jungjinbeom 2f39969
chore: 사용하지 않는 파일 제거
jungjinbeom e2ea372
import 구문 정리
jungjinbeom 5aa5572
커스텀훅 추가
jungjinbeom 0ba4fe6
context삭제
jungjinbeom bcf9105
Lookup table 형식으로 변경
jungjinbeom 12df3c4
portal 추가
jungjinbeom 2e456dc
사용하지 않는 컴포넌트 삭제
jungjinbeom 6fba43b
import 구문 정리 및 개행 추가
jungjinbeom b2b1123
개행 추가, 베럴 Import 형식으로 변경
jungjinbeom 63ebfd4
Error 에러문 수정
jungjinbeom 9b55a26
개월 최소값 수정
jungjinbeom d11174f
사용하지 않는 컴포넌트 삭제
jungjinbeom 7ab4aa6
커스텀 훅 추가
jungjinbeom b87daaf
유효성 검사 함수 명 수정
jungjinbeom 8960a2f
import 구문 구성 수정 및 개행 추가
jungjinbeom 1a8e18a
import 구문 추가 및 개행 추가
jungjinbeom a834c1f
navigate함수에 useCallback 추가
jungjinbeom 598c22f
사용하지 않는 룰 삭제
jungjinbeom 55d1411
Stepper null 처리
jungjinbeom 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
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 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import CardBox from './parts/CardBox'; | ||
import CardForm from './parts/CardForm'; | ||
|
||
interface EmptyCardProps { | ||
type EmptyCardProps = { | ||
onClick: () => void; | ||
} | ||
const EmptyCard = ({ onClick }: EmptyCardProps) => { | ||
return ( | ||
<CardBox onClick={onClick}> | ||
<CardForm status="empty"> | ||
<div>+</div> | ||
</CardForm> | ||
</CardBox> | ||
); | ||
}; | ||
|
||
export default EmptyCard; | ||
export const EmptyCard = ({ onClick }: EmptyCardProps) => ( | ||
<CardBox onClick={onClick}> | ||
<CardForm status="empty"> | ||
<div>+</div> | ||
</CardForm> | ||
</CardBox> | ||
); |
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,2 @@ | ||
export { Card } from './Card'; | ||
export { EmptyCard } from './EmptyCard'; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { type PropsWithChildren } from 'react'; | ||
|
||
const CardBottom = ({ children }: PropsWithChildren) => { | ||
return <div className="card-bottom">{children}</div>; | ||
}; | ||
const CardBottom = ({ children }: PropsWithChildren) => ( | ||
<div className="card-bottom">{children}</div> | ||
); | ||
|
||
export default CardBottom; |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { type PropsWithChildren } from 'react'; | ||
|
||
interface CardBoxProps extends PropsWithChildren { | ||
type CardBoxProps = { | ||
onClick?: () => void; | ||
} | ||
const CardBox = ({ onClick, children }: CardBoxProps) => { | ||
return ( | ||
<div onClick={onClick} className="card-box"> | ||
{children} | ||
</div> | ||
); | ||
}; | ||
} & PropsWithChildren; | ||
|
||
const CardBox = ({ onClick, children }: CardBoxProps) => ( | ||
<div onClick={onClick} className="card-box"> | ||
{children} | ||
</div> | ||
); | ||
|
||
export default CardBox; |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import classNames from 'classnames'; | ||
import { PropsWithChildren } from 'react'; | ||
|
||
interface CardFormProps extends PropsWithChildren { | ||
import { type HTMLAttributes, type PropsWithChildren } from 'react'; | ||
type BaseCardFormProps = HTMLAttributes<HTMLDivElement>; | ||
type CardFormProps = { | ||
status: string; | ||
} | ||
const CardForm = ({ status, children }: CardFormProps) => { | ||
return <div className={classNames(`${status}-card`)}>{children}</div>; | ||
}; | ||
} & PropsWithChildren<BaseCardFormProps>; | ||
|
||
const CardForm = ({ status, children, style }: CardFormProps) => ( | ||
<div className={classNames(`${status}-card`)} style={style}> | ||
{children} | ||
</div> | ||
); | ||
|
||
export default CardForm; |
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 |
---|---|---|
@@ -1,24 +1,14 @@ | ||
import { CardNumbersType } from '@/domain/type'; | ||
import CardText from './CardText'; | ||
|
||
const REGEX = /[1-9]/gi; | ||
interface CardNumbersProps extends CardNumbersType { | ||
type CardNumbersProps = { | ||
status: 'big' | 'small' | 'empty'; | ||
} | ||
const CardNumbers = ({ | ||
status, | ||
first = '', | ||
second = '', | ||
third = '', | ||
fourth = '', | ||
}: CardNumbersProps) => { | ||
return ( | ||
<div className="card-bottom__number"> | ||
<CardText | ||
status={status} | ||
>{`${first} ${second} ${third.replace(REGEX, '*')} ${fourth.replace(REGEX, '*')}`}</CardText> | ||
</div> | ||
); | ||
cardNumber: string; | ||
}; | ||
|
||
const CardNumbers = ({ status, cardNumber }: CardNumbersProps) => ( | ||
<div className="card-bottom__number"> | ||
<CardText status={status}>{cardNumber}</CardText> | ||
</div> | ||
); | ||
|
||
export default CardNumbers; |
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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import classNames from 'classnames'; | ||
import { DetailedHTMLProps, PropsWithChildren } from 'react'; | ||
import { type HTMLAttributes, type PropsWithChildren } from 'react'; | ||
|
||
type BaseCardTextProps = DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>; | ||
interface CardTextProps extends BaseCardTextProps, PropsWithChildren { | ||
type BaseCardTextProps = HTMLAttributes<HTMLSpanElement>; | ||
|
||
type CardTextProps = { | ||
status: string; | ||
} | ||
} & PropsWithChildren<BaseCardTextProps>; | ||
|
||
const CardText = ({ status, children }: CardTextProps) => { | ||
return ( | ||
<span className={classNames(status === 'big' ? 'card-text__big' : 'card-text')}> | ||
{children} | ||
</span> | ||
); | ||
}; | ||
const CardText = ({ status, children }: CardTextProps) => ( | ||
<span className={classNames(status === 'big' ? 'card-text__big' : 'card-text')}>{children}</span> | ||
); | ||
|
||
export default CardText; |
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { type PropsWithChildren } from 'react'; | ||
|
||
const CardTitle = ({ children }: PropsWithChildren) => { | ||
return <div className="card-top">{children}</div>; | ||
}; | ||
const CardTitle = ({ children }: PropsWithChildren) => <div className="card-top">{children}</div>; | ||
|
||
export default CardTitle; |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import classNames from 'classnames'; | ||
|
||
interface ChipProps { | ||
type ChipProps = { | ||
status: 'small' | 'big' | 'empty'; | ||
} | ||
const Chip = ({ status }: ChipProps) => { | ||
return <div className={classNames(status === 'big' ? 'big-card__chip' : 'small-card__chip')} />; | ||
}; | ||
|
||
const Chip = ({ status }: ChipProps) => ( | ||
<div className={classNames(status === 'big' ? 'big-card__chip' : 'small-card__chip')} /> | ||
); | ||
|
||
export default Chip; |
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import classNames from 'classnames'; | ||
import { DetailedHTMLProps, HTMLAttributes, PropsWithChildren } from 'react'; | ||
import { type DetailedHTMLProps, type HTMLAttributes, type PropsWithChildren } from 'react'; | ||
|
||
type BaseButtonBox = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>; | ||
interface ButtonBoxProps extends BaseButtonBox, PropsWithChildren {} | ||
|
||
const ButtonBox = ({ className, children }: ButtonBoxProps) => { | ||
return <div className={classNames(className, 'button-box')}>{children}</div>; | ||
}; | ||
type ButtonBoxProps = Record<string, unknown> & PropsWithChildren<BaseButtonBox>; | ||
|
||
export default ButtonBox; | ||
export const ButtonBox = ({ className, children }: ButtonBoxProps) => ( | ||
<div className={classNames(className, 'button-box')}>{children}</div> | ||
); |
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.
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.
훨씬 선언적으로 되었네요 👍