From 2dc4971c3534bcd28f0938bb9c354c4d481d57d3 Mon Sep 17 00:00:00 2001 From: JayJay1024 Date: Tue, 18 Jan 2022 18:06:18 +0800 Subject: [PATCH] feat(airdrop): comfirm modal title --- .../ClaimAirdrop/SubComponent/index.tsx | 60 +++++++++++++++++ src/component/ClaimAirdrop/index.tsx | 39 +++-------- src/component/ClaimAirdrop/styles.module.scss | 65 +++++++++++++++++++ 3 files changed, 135 insertions(+), 29 deletions(-) create mode 100644 src/component/ClaimAirdrop/SubComponent/index.tsx diff --git a/src/component/ClaimAirdrop/SubComponent/index.tsx b/src/component/ClaimAirdrop/SubComponent/index.tsx new file mode 100644 index 00000000..dcff8530 --- /dev/null +++ b/src/component/ClaimAirdrop/SubComponent/index.tsx @@ -0,0 +1,60 @@ +import React from 'react'; +import clsx from 'clsx'; +import styles from '../styles.module.scss'; +import { Modal } from 'antd'; + +export const ComfirmModalTitleWithCRAB = ({ crabQuantity='100' }) => ( +
+ Claim CRAB Token + {crabQuantity} CRAB +
+); + +export const ComfirmModalTitleForSorry = ({ crabQuantity='200,000' }) => ( +
+ {`Sorry, ${crabQuantity} CRAB has been distributed.`} +
+); + +export const ComfirmModalTitleForComfirm = () => ( +
+ Confirm Information + Please review your destination address +
+); + +export const ComfirmModalTitleForCcongratulation = () => ( +
+ Congratulations! +
+); + +export const ComfirmModalButton = ({ + text='OK', + onClick=()=>{}, + disabled=false, +}) => ( + +) + +export const ComfirmModal = ({ + visible=false, + title=null, + footer=null, + children=null, + onCancel=()=>{}, +}) => { + return ( + + {children} + + ); +}; diff --git a/src/component/ClaimAirdrop/index.tsx b/src/component/ClaimAirdrop/index.tsx index d7074b5f..a4d6b41c 100644 --- a/src/component/ClaimAirdrop/index.tsx +++ b/src/component/ClaimAirdrop/index.tsx @@ -1,35 +1,14 @@ import React, { useState } from 'react'; import clsx from 'clsx'; import styles from './styles.module.scss'; -import { Modal } from 'antd'; - -const ComfirmModalButton = ({ - text='OK', - onClick=()=>{}, - disabled=false, -}) => ( - -) - -const ComfirmModal = ({ - visible=false, - title=null, - footer=null, - children=null, -}) => { - return ( - - {children} - - ); -}; +import { + ComfirmModal, + ComfirmModalButton, + ComfirmModalTitleWithCRAB, + ComfirmModalTitleForSorry, + ComfirmModalTitleForComfirm, + ComfirmModalTitleForCcongratulation, +} from './SubComponent'; type Props = { className?: string; @@ -52,7 +31,9 @@ const ClaimAirdrop: React.FC = ({ className }) => { } footer={ setVisibleComfirmModal(false)} disabled={true} />} + onCancel={() => setVisibleComfirmModal(false)} /> ); diff --git a/src/component/ClaimAirdrop/styles.module.scss b/src/component/ClaimAirdrop/styles.module.scss index 66ee0670..b28042d6 100644 --- a/src/component/ClaimAirdrop/styles.module.scss +++ b/src/component/ClaimAirdrop/styles.module.scss @@ -51,6 +51,71 @@ } } +.titleComfirmModalWithCRAB { + display: flex; + flex-direction: column; + width: 100%; + + >span { + color: #ffffff; + + &:first-child { + font-size: small; + margin-bottom: 10px; + } + + &:last-child { + font-weight: bolder; + } + } +} + +.titleComfirmModalForSorry { + width: 100%; + padding: 15px 0; + display: flex; + align-items: center; + justify-content: center; + + >span { + color: #ffffff; + font-size: small; + } +} + +.titleComfirmModalForComfirm { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + + >span { + color: #ffffff; + + &:first-child { + font-weight: bolder; + margin-bottom: 6px; + } + + &:last-child { + font-size: small; + } + } +} + +.titleComfirmModalForCongratulation { + width: 100%; + padding: 18px 0; + display: flex; + align-items: center; + justify-content: center; + + >span { + color: #ffffff; + font-weight: bolder; + } +} + .comfirmModal { :global { .ant-modal-content {