Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e1a14a3
docs : readme 기능구현 작성
mun-kyeong Apr 15, 2025
2e7dd5d
style: styled-compoents 설치
jaeyoung-kwon Apr 15, 2025
a29c2f6
chore: prettier 세팅
jaeyoung-kwon Apr 15, 2025
702622a
feat: Payments 레이아웃 적용
jaeyoung-kwon Apr 15, 2025
67bae32
feat : cardPreview 컴포넌트 제작
mun-kyeong Apr 15, 2025
ed33a64
refactor : style 컴포넌트 위치 변경
mun-kyeong Apr 15, 2025
b04af68
feat : InputSection props 정의
mun-kyeong Apr 15, 2025
85d0b6c
fix : CardPreview 오타 수정
jaeyoung-kwon Apr 15, 2025
d728080
style : Noto sans font 적용
jaeyoung-kwon Apr 15, 2025
b478d02
feat : InputSection 컴포넌트 제작
jaeyoung-kwon Apr 15, 2025
fe2b5b0
feat : InputFiled 컴포넌트 제작
mun-kyeong Apr 15, 2025
8ba4cde
style : global font family 적용
jaeyoung-kwon Apr 15, 2025
072a558
feat : InputField 스타일 적용
jaeyoung-kwon Apr 15, 2025
cc4b7dc
feat : CardNumber InputFiled 컴포넌트 제작
mun-kyeong Apr 16, 2025
4c5caf3
feat : ExpirationDateInputField, CVCInputField 컴포넌트 제작
jaeyoung-kwon Apr 16, 2025
caafa31
feat : input type 숫자로 제한
mun-kyeong Apr 16, 2025
c535b3a
feat : input 길이제한
mun-kyeong Apr 16, 2025
95a180f
feat : type=text로 변환 및 inputMode 추가
mun-kyeong Apr 16, 2025
27fa749
feat : 카드 번호를 바탕으로 card type 판단
jaeyoung-kwon Apr 16, 2025
26bbbac
feat : card type이 존재하지 않을 경우 에러 처리
jaeyoung-kwon Apr 16, 2025
4d96821
feat : card type이 존재하지 않을 경우 에러 메시지 보여주기
mun-kyeong Apr 16, 2025
1c028fe
refactor : input value 상태를 부모 컴포넌트로 이동
jaeyoung-kwon Apr 16, 2025
85f4e3d
feat : cardPreview input 값 반영
mun-kyeong Apr 16, 2025
c65d7a2
feat : CardNumberMask 컴포넌트 적용
jaeyoung-kwon Apr 16, 2025
690afe1
feat : CardPreview 에서 cardType 적용
mun-kyeong Apr 16, 2025
bf1c726
feat : CarcNumber가 4자리가 안될 경우 에러 처리
mun-kyeong Apr 17, 2025
ba86ac9
feat : Storybook Input 컴포넌트 제작
jaeyoung-kwon Apr 17, 2025
a384146
feat : Storybook CardPreview 컴포넌트 제작
mun-kyeong Apr 17, 2025
1177c9e
feat : Storybook BaseInputField 컴포넌트 제작
jaeyoung-kwon Apr 17, 2025
073ec38
style : Storybook 폰트 적용
jaeyoung-kwon Apr 17, 2025
951ed81
feat : Storybook 컴포넌트 story 추가
mun-kyeong Apr 17, 2025
c1aa195
refactor : CardNumberInputField에서 Input 중복코드 제거
mun-kyeong Apr 17, 2025
ab9da6b
refactor : type, constant 코드 파일 분리
jaeyoung-kwon Apr 17, 2025
7b46bef
refactor : ExpirationDateInputField에서 Input 중복코드 제거
jaeyoung-kwon Apr 17, 2025
760ed7c
refactor : CardInfoBox 컴포넌트 분리 및 컴포넌트 파일 가독성 향상
mun-kyeong Apr 17, 2025
98a4e23
refactor: map에 key 지정
jaeyoung-kwon Apr 17, 2025
9697b55
chore : deploy 환경 설정
jaeyoung-kwon Apr 17, 2025
a82ccd0
refactor : ExpirationDateInputField placeholder 추가
jaeyoung-kwon Apr 17, 2025
d8f983b
fix : 이미지 경로 수정
jaeyoung-kwon Apr 17, 2025
8880bd7
fix: 이미지 public 폴더 추가
jaeyoung-kwon Apr 17, 2025
845248c
refactor: cardType null을 상태를 나타내는 type으로 보강
jaeyoung-kwon Apr 21, 2025
f143dbd
refactor: children type을 추가해주는 StrictPropsWithChildren 추가
jaeyoung-kwon Apr 21, 2025
f31e1d8
refactor: 하드 코딩된 값 상수로 분리
jaeyoung-kwon Apr 21, 2025
179187a
refactor: index.html 파일 기본 언어 "ko"로 변경
jaeyoung-kwon Apr 21, 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
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"quoteProps": "as-needed",
"singleQuote": true,
"printWidth": 80,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"bracketSameLine": false
}
10 changes: 9 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { Preview } from "@storybook/react";
import type { Preview } from '@storybook/react';
import '../reset.css';
import { withThemeFromJSXProvider } from '@storybook/addon-themes';
import GlobalStyles from '../styles/global.ts';

const preview: Preview = {
parameters: {
Expand All @@ -9,6 +12,11 @@ const preview: Preview = {
},
},
},
decorators: [
withThemeFromJSXProvider({
GlobalStyles,
}),
],
};

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

- 카드 번호 입력 및 식별
- [x] Visa나 MasterCard에 해당하면 해당 브랜드의 로고를 UI에 표시한다.

- [x] 입력은 숫자만 가능하다.
- [x] 사용자가 입력하는 카드 번호를 실시간으로 파악한다.
- [x] 유효하지 않은 번호 입력 시 피드백을 제공한다.
- 카드 브랜드 구분 로직 (Visa / MasterCard)
- [x] Visa: 4로 시작하는 16자리 숫자
- [x] MasterCard: 51~55로 시작하는 16자리 숫자
- 카드 유효기간 입력
- [x] 월과 년도를 범위 내에서만 입력할 수 있어야 한다.
- [x] 입력 제한을 두어 사용자가 숫자만 입력할 수 있도록 한다.

- 실시간 프리뷰 업데이트
- [x] 사용자의 카드 정보 입력에 따라 카드 프리뷰를 동시에 업데이트한다.
1 change: 1 addition & 0 deletions fonts.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.ttf';
Binary file added fonts/Inter-VariableFont_opsz,wght.ttf
Binary file not shown.
Binary file added fonts/NotoSansKR-VariableFont_wght.ttf
Binary file not shown.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="stylesheet" href="./reset.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React Payments</title>
</head>
Expand Down
Loading