0.3.5 • Published 1 month ago

@dongminahn/react-payments v0.3.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

🚀 Getting Started

import { PaymentModal, Payment } from "@dongminahn/react-payments";

function App() {
  const { isModalOpen, onClose, onOpen } = PaymentModal.useModal();
  return (
    <>
      <button onClick={onOpen}>결제하기</button>
      {isModalOpen && (
        <PaymentModal.Modal isOpen={isModalOpen} onClose={onClose}>
          <Payment
            price={2000}
            onSuccess={({ massage }) => {
              alert(massage);
              onClose();
            }}
          />
        </PaymentModal.Modal>
      )}
    </>
  );
}

📦 Installation

yarn add @ahndongmin/react-payment

npm install @ahndongmin/react-payment

📚 Dependencies

  • React
  • Typescript
  • Emotion
  • Storybook

Component

Payment

propstypedescription
pricenumber결제 금액
onSuccessfunction결제 성공시 콜백 함수
onFailfunction결제 실패시 콜백 함수

PaymentModal.Modal

propstypedescription
isOpenboolean모달 오픈 여부
onClosefunction모달 닫기 콜백 함수

PaymentModal.useModal

returntypedescription
isModalOpenboolean모달 오픈 여부
onClosefunction모달 닫기 콜백 함수
onOpenfunction모달 오픈 콜백 함수
컴포넌트 명props
CardcardName, cardNumber, userName, expirationMonth,expirationYear
Headertitle, onLeftIconClick, LeftIcon
Inputplaceholder, onChange , value , id , width, textAlign
CardCategoryITemname, color
LabeltextLength, limit , children , title
BottomModal바텀 모달 컴포넌트
TextButtontext , onClick
CardAddButtononClick
LineInputvalue , onChange

0.3.5

1 month ago

0.3.4

11 months ago

0.3.3

11 months ago

0.3.2

11 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago

0.0.0

11 months ago