Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
adf5f97
docs : 기능 요구사항 정리
hanheel Apr 15, 2025
6b52f9d
style : 디자인 시스템 정리
hanheel Apr 15, 2025
6e7e189
style : reset.css 설정
hanheel Apr 15, 2025
bd81e59
feat : Description 컴포넌트 제작
hanheel Apr 16, 2025
655d5eb
feat : Input 컴포넌트 제작
hanheel Apr 16, 2025
2d89a70
feat: 카드 컴포넌트 생성
bunju20 Apr 16, 2025
6b3b78d
feat : 카드 타입에 따라 visa 또는 mastercard 로고 생성
hanheel Apr 16, 2025
dea8268
feat : LabeledInput 컴포넌트 제작
hanheel Apr 16, 2025
b2b3866
feat : 레이블 input 타입 매칭
hanheel Apr 16, 2025
54e7f2d
feat: pages UI 제작
bunju20 Apr 16, 2025
b66ea2d
style: pages css gap 변경
bunju20 Apr 16, 2025
20d11d9
feat : 카드 번호를 입력 받고 카드 프리뷰에 반영
hanheel Apr 16, 2025
e6e749b
fix : input maxLength 설정되지 않은 오류 해결
hanheel Apr 16, 2025
832ab47
fix: 카드 번호 위치에 맞도록 수정
bunju20 Apr 16, 2025
289da93
feat: 유효성 검사 및 오류 처리 로직 구현
bunju20 Apr 16, 2025
01129d6
fix : input값이 0인 경우 유효성 검사 배제
hanheel Apr 16, 2025
2a443fe
feat : 카드번호 마스킹 기능 제작
hanheel Apr 16, 2025
ccdfbfe
docs : 기능 요구사항 업데이트
hanheel Apr 16, 2025
7c72963
feat: 카드 첫 번호에 따라 BrandLogo 변경 로직 구현
bunju20 Apr 16, 2025
c0960af
refactor : 에러메세지 상수 분리
hanheel Apr 16, 2025
66df469
refactor : justifyLogoBrand 함수 분리
hanheel Apr 16, 2025
483a024
refactor : 불필요한 errorMessage 삭제
hanheel Apr 16, 2025
3e13b94
feat : InputGroup 스토리 작성
hanheel Apr 17, 2025
ca082dc
feat: storyBook 배포 및 inputGroup 수정
bunju20 Apr 17, 2025
fbcd788
feat: 카드 스토리 (visa, default, mastercar)추가
bunju20 Apr 17, 2025
d21412c
feat: Card Story (카드번호, 유효기간) 구현
bunju20 Apr 17, 2025
ccbd187
refactor : 불필요한 style 삭제
hanheel Apr 17, 2025
5e36b0d
fix : 에러 메세지가 덮어씌워지는 오류 해결
hanheel Apr 17, 2025
231fda8
refactor : erroMessages에 함수대신 상수 전달
hanheel Apr 17, 2025
6e986c4
feat : 카드 번호 유효기간 실시간 입력 반영
hanheel Apr 17, 2025
ddee8f9
refactor : maskingNumber 유틸함수 card 폴더 내로 이동
hanheel Apr 17, 2025
a7eb106
fix : 스토리북 에러 메세지 해결
hanheel Apr 17, 2025
b1f7722
chore : 배포 설정
hanheel Apr 17, 2025
45aee65
chore : storybook 정적파일 깃 ignore 설정
hanheel Apr 19, 2025
0e9ed3c
chore : storybook 정적파일 캐시 삭제
hanheel Apr 19, 2025
43006f6
feat : globalStyle 적용
hanheel Apr 19, 2025
422b971
refactor : 스토리북과 컴포넌트를 가깝게 위치
hanheel Apr 19, 2025
730d596
refactor : 유틸 함수 위치 src/util로 수정
hanheel Apr 19, 2025
01efe57
refactor : Input을 CardInput으로 변경
hanheel Apr 20, 2025
7c47b45
refactor : AddCard에서 CardNumberInput 컴포넌트 분리
hanheel Apr 20, 2025
ff4693c
refactor : AddCard에서 ExpirationDateInputs 컴포넌트 분리
hanheel Apr 20, 2025
fe569e9
refactor : AddCard에서 CVCInputs 컴포넌트 분리
hanheel Apr 20, 2025
8f3a10b
refactor : div 태그를 form으로 변경
hanheel Apr 20, 2025
129bed0
refactor : CardNumberInputs에서 반복되는 CardInput 추상화
hanheel Apr 20, 2025
d92f4b2
refactor : ExpirationDateInputs에서 반복되는 CardInput 추상화
hanheel Apr 20, 2025
8e63087
refactor : getFirstErrorMessage 추상화
hanheel Apr 20, 2025
13c468b
refactor : styled-component의 위치를 로직 하단으로 수정
hanheel Apr 20, 2025
176042f
refactor: CardNumber 컴포넌트 분리
hanheel Apr 20, 2025
503183c
refactor : InputType을 CardInputProps의 key로 통일
hanheel Apr 20, 2025
306e6c0
feat : label과 input을 id로 연결
hanheel Apr 20, 2025
7f793f0
refactor : InputProps가 ComponentProps를 확장하도록 변경
hanheel Apr 20, 2025
b11c48d
refactor : 스토리 코드 파일 분리
hanheel Apr 20, 2025
ec84d0a
refactor : 사용하지 않는 state 삭제
hanheel Apr 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dist-ssr
*.sln
*.sw?

*storybook.log
*storybook.log
storybook-static
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config: StorybookConfig = {
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
"@storybook/addon-themes"
],
framework: {
name: "@storybook/react-vite",
Expand Down
33 changes: 33 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { Preview } from "@storybook/react";
import GlobalStyles from "../src/GlobalStyles";
import { withThemeFromJSXProvider } from "@storybook/addon-themes";

const preview: Preview = {
parameters: {
Expand All @@ -8,7 +10,38 @@ const preview: Preview = {
date: /Date$/i,
},
},
viewport: {
viewports: {
mobile: {
name: "Mobile",
styles: {
width: "360px",
height: "640px",
},
},
tablet: {
name: "Tablet",
styles: {
width: "768px",
height: "1024px",
},
},
desktop: {
name: "Desktop",
styles: {
width: "1024px",
height: "768px",
},
},
},
},
},
};

export const decorators = [
withThemeFromJSXProvider({
GlobalStyles,
}),
];

export default preview;
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
# react-payments

## ✅ 프로그램 설명

사용자에게 올바른 카드 정보를 입력 받고 카드 프리뷰를 실시간으로 보여준다

## 🛠️ 기능 요구 사항

### 번호를 입력 받는다

- [x] 카드 번호를 입력 받는다
- [x] 카드 유효기간을 입력 받는다
- [x] cvc 번호를 입력 받는다

### 카드 프리뷰

- 카드 이미지

- [x] 카드 번호를 입력하면 카드 프리뷰에 입력한 값을 보여준다
- [x] 카드 번호 세 번째~네 번째 칸에 값을 입력할 경우 암호화 한다
- [x] 카드 유효기간을 입력할 경우 카드 프리뷰에 입력한 값을 보여준다

- 카드 아이콘
- [] 카드 번호가 4로 시작할 경우 카드 프리뷰에 visa 아이콘을 보여준다
- [] 카드 번호가 51~52로 시작하거나 2221~2720으로 시작할 경우 카드 프리뷰에 master card 아이콘을 보여준다

### 입력 받은 값에 대해 유효성 검사를 실시한다

- 카드번호
- [x] 각 카드 번호는 숫자여야 한다
- [x] 각 카드 번호는 4자리여야 한다
- 카드 유효 기간
- [x] 유효 기간 YY은 현재 연도보다 크거나 같아야 한다
- [x] 유효 기간 MM은 1~31 사이 숫자를 입력해야 한다
- cvc번호
- [x] cvc 번호는 3자리로 입력해야 한다

### 에러 처리

- [x] 입력 값이 유효하지 않은 경우 input에 border 색상이 변경된다
- [x] 입력 값이 유효하지 않은 경우 에러 메세지를 출력한다
Loading