Skip to content

Commit

Permalink
Merge pull request #85 from TrustlessComputer/feat/airdrop-naka
Browse files Browse the repository at this point in the history
Feat/airdrop naka
  • Loading branch information
0xmegalodon authored Jan 20, 2024
2 parents 5811330 + 348dae5 commit 27b8a7e
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 148 deletions.
2 changes: 1 addition & 1 deletion src/modules/Whitelist/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Whitelist = () => {
) : (
<AppLoading />
)}
<Box mt="40px" />
<Box mt={['0px', '40px']} />
</>
);
};
Expand Down
97 changes: 45 additions & 52 deletions src/modules/Whitelist/stepAirdrop/Step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function ItemCommunity({
alt="ic-section"
/>
<Flex direction="column" gap="8px" flex={1}>
<Flex justifyContent="space-between" gap="16px">
<Flex direction={["column", "row"]} justifyContent="space-between" gap={[1, 4]}>
<Flex direction="column" w="100%">
<Flex gap={2}>
<div className={cx(s.itemCommunity__tag, s[AirdropText[content?.airdropType].toLowerCase()])}>{AirdropText[content?.airdropType]}</div>
Expand All @@ -94,60 +94,11 @@ export default function ItemCommunity({
}
</Flex>
}
{!!content?.actionText && (
<Flex direction="column" w="100%" mt="8px">
<Flex gap="8px" flexDirection="column" w="100%">
<Button
className={s.itemCommunity__btnCTA}
onClick={() => {
if (content?.actionHandle && isRunning && !isLoading) {
content?.actionHandle();
}
}}
isLoading={isLoading}
isDisabled={isDisable}
>
{
!content?.showExpireTime && !!content?.expiredTime ? (
<Flex direction={"column"} justifyContent={"center"} gap={1} mt={2} mb={2}>
<Countdown className={s.itemCommunity__countdown_button} expiredTime={dayjs.utc(content?.expiredTime, 'YYYY-MM-DD HH:mm:ss').toString()} hideIcon={true} />
</Flex>
) : (content?.actionText)
}
</Button>
{!!content.actionHandleSecondary && (
<Button
className={cs(
s.itemCommunity__btnCTA,
s.itemCommunity__btnSecondary,
)}
onClick={() => {
if (
content?.actionHandleSecondary &&
isRunning &&
!isLoading
) {
content?.actionHandleSecondary();
}
}}
>
{content?.actionTextSecondary}
</Button>
)}
</Flex>
</Flex>
)}
</Flex>
<Flex direction="column">
<Flex direction={["row", 'column']} justifyContent={["space-between", "flex-start"]}>
<div className={s.itemCommunity__point}>
{content?.right.title}
{
content?.right.tooltip && (
<>
{content?.right.tooltip}
</>
)
}
{content?.right.tooltip && <>{content?.right.tooltip}</>}
</div>
{!!content?.desc && (
<div className={s.itemCommunity__pointNote}>
Expand All @@ -156,6 +107,48 @@ export default function ItemCommunity({
)}
</Flex>
</Flex>
{!!content?.actionText && (
<Flex direction="column" w="100%" mt="8px">
<Flex gap="8px" flexDirection="column" w="100%">
<Button
className={s.itemCommunity__btnCTA}
onClick={() => {
if (content?.actionHandle && isRunning && !isLoading) {
content?.actionHandle();
}
}}
isLoading={isLoading}
>
{
!content?.showExpireTime && !!content?.expiredTime ? (
<Flex direction={"column"} justifyContent={"center"} gap={1} mt={2} mb={2}>
<Countdown className={s.itemCommunity__countdown_button} expiredTime={dayjs.utc(content?.expiredTime, 'YYYY-MM-DD HH:mm:ss').toString()} hideIcon={true} />
</Flex>
) : (content?.actionText)
}
</Button>
{!!content.actionHandleSecondary && (
<Button
className={cs(
s.itemCommunity__btnCTA,
s.itemCommunity__btnSecondary,
)}
onClick={() => {
if (
content?.actionHandleSecondary &&
isRunning &&
!isLoading
) {
content?.actionHandleSecondary();
}
}}
>
{content?.actionTextSecondary}
</Button>
)}
</Flex>
</Flex>
)}
</Flex>
</div>
</>
Expand Down
114 changes: 57 additions & 57 deletions src/modules/Whitelist/steps/Step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,71 +63,71 @@ export default function ItemCommunity({
<div className={cx(s.itemCommunity, isRunning ? '' : s.isDone)}>
<Image className={s.itemCommunity__logo} width={48} height={48} src={`${CDN_URL_ICONS}/${image}`} alt="ic-section" />
<Flex direction="column" gap="8px" flex={1}>
<Flex justifyContent="space-between" gap="16px">
<Flex direction={["column", "row"]} justifyContent="space-between" gap={[1, 4]}>
<Flex direction="column" w="100%">
<div className={s.itemCommunity__title}>{content?.title}</div>
{!!content?.desc && (<div className={s.itemCommunity__desc}>{content?.desc}</div>)}
{!!content?.actionText && (
<Flex direction="column" w="100%" mt="8px">
<Flex gap="8px" flexDirection="column" w="100%">
<Button
className={s.itemCommunity__btnCTA}
onClick={() => {
if (content?.actionHandle && isRunning && !isLoading) {
content?.actionHandle();
if (step === MultiplierStep.authen) {
setTimeout(() => {
setShowManualCheck(true);
}, 15000);
}
}
}}
isLoading={isLoading}
>
{content?.actionText}
</Button>
{!!content.actionHandleSecondary && (
<Button
className={cs(s.itemCommunity__btnCTA, s.itemCommunity__btnSecondary)}
onClick={() => {
if (content?.actionHandleSecondary && isRunning && !isLoading) {
content?.actionHandleSecondary();
}
}}
>
{content?.actionTextSecondary}
</Button>
)}
{step === MultiplierStep.signMessage && (
<AllowBTCMessage />
)}
{step === MultiplierStep.modular && (
<AllowCelestiaMessage />
)}
</Flex>
{
step === MultiplierStep.authen && showManualCheck && (
<Text
cursor={"pointer"}
fontSize={"14px"}
fontWeight={400}
color={"#000000"}
textDecoration={"underline"}
onClick={content?.handleShowManualPopup}
mt={1}
>
Missing from the Leaderboard?
</Text>
)
}
</Flex>
)}
</Flex>
<Flex direction="column">
<Flex direction={["row", 'column']} justifyContent={["space-between", "flex-start"]}>
<div className={s.itemCommunity__point}>{content?.right.title}</div>
{!!content?.desc && (<div className={s.itemCommunity__pointNote}>{content?.right.desc}</div>)}
</Flex>
</Flex>
{!!content?.actionText && (
<Flex direction="column" w="100%" mt="8px">
<Flex gap="8px" flexDirection="column" w="100%">
<Button
className={s.itemCommunity__btnCTA}
onClick={() => {
if (content?.actionHandle && isRunning && !isLoading) {
content?.actionHandle();
if (step === MultiplierStep.authen) {
setTimeout(() => {
setShowManualCheck(true);
}, 15000);
}
}
}}
isLoading={isLoading}
>
{content?.actionText}
</Button>
{!!content.actionHandleSecondary && (
<Button
className={cs(s.itemCommunity__btnCTA, s.itemCommunity__btnSecondary)}
onClick={() => {
if (content?.actionHandleSecondary && isRunning && !isLoading) {
content?.actionHandleSecondary();
}
}}
>
{content?.actionTextSecondary}
</Button>
)}
{step === MultiplierStep.signMessage && (
<AllowBTCMessage />
)}
{step === MultiplierStep.modular && (
<AllowCelestiaMessage />
)}
</Flex>
{
step === MultiplierStep.authen && showManualCheck && (
<Text
cursor={"pointer"}
fontSize={"14px"}
fontWeight={400}
color={"#000000"}
textDecoration={"underline"}
onClick={content?.handleShowManualPopup}
mt={1}
>
Missing from the Leaderboard?
</Text>
)
}
</Flex>
)}
</Flex>
</div>
</>
Expand Down
76 changes: 38 additions & 38 deletions src/modules/Whitelist/stepsEco/Step/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function ItemCommunity({
alt="ic-section"
/>
<Flex direction="column" gap="8px" flex={1}>
<Flex justifyContent="space-between" gap="16px">
<Flex direction={["column", "row"]} justifyContent="space-between" gap={[1, 4]}>
<Flex direction="column" w="100%">
<div className={s.itemCommunity__project}>{content?.project}</div>
<div className={s.itemCommunity__title}>{content?.title}</div>
Expand All @@ -65,44 +65,8 @@ export default function ItemCommunity({
}}
/>
)}
{!!content?.actionText && (
<Flex direction="column" w="100%" mt="8px">
<Flex gap="8px" flexDirection="column" w="100%">
<Button
className={s.itemCommunity__btnCTA}
onClick={() => {
if (content?.actionHandle && isRunning && !isLoading) {
content?.actionHandle();
}
}}
isLoading={isLoading}
>
{content?.actionText}
</Button>
{!!content.actionHandleSecondary && (
<Button
className={cs(
s.itemCommunity__btnCTA,
s.itemCommunity__btnSecondary,
)}
onClick={() => {
if (
content?.actionHandleSecondary &&
isRunning &&
!isLoading
) {
content?.actionHandleSecondary();
}
}}
>
{content?.actionTextSecondary}
</Button>
)}
</Flex>
</Flex>
)}
</Flex>
<Flex direction="column">
<Flex direction={["row", 'column']} justifyContent={["space-between", "flex-start"]}>
<div className={s.itemCommunity__point}>
{content?.right.title}
{content?.right.tooltip && <>{content?.right.tooltip}</>}
Expand All @@ -114,6 +78,42 @@ export default function ItemCommunity({
)}
</Flex>
</Flex>
{!!content?.actionText && (
<Flex direction="column" w="100%" mt="8px">
<Flex gap="8px" flexDirection="column" w="100%">
<Button
className={s.itemCommunity__btnCTA}
onClick={() => {
if (content?.actionHandle && isRunning && !isLoading) {
content?.actionHandle();
}
}}
isLoading={isLoading}
>
{content?.actionText}
</Button>
{!!content.actionHandleSecondary && (
<Button
className={cs(
s.itemCommunity__btnCTA,
s.itemCommunity__btnSecondary,
)}
onClick={() => {
if (
content?.actionHandleSecondary &&
isRunning &&
!isLoading
) {
content?.actionHandleSecondary();
}
}}
>
{content?.actionTextSecondary}
</Button>
)}
</Flex>
</Flex>
)}
</Flex>
</div>
</>
Expand Down
2 changes: 2 additions & 0 deletions src/modules/Whitelist/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,14 @@
.chakra-tabs__tablist {
position: relative;
width: 100%;
overflow-x: auto;

button {
font-size: 24px;
color: #494846;
border-bottom-width: 0px !important;
text-align: left;
white-space: nowrap;

@include w-max(720px) {
font-size: 15px;
Expand Down

0 comments on commit 27b8a7e

Please sign in to comment.