-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from TrustlessComputer/feat/airdrop-naka
Feat/airdrop naka
- Loading branch information
Showing
11 changed files
with
356 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import { CDN_URL_ICONS } from '@/config'; | ||
import { Button, Flex } from '@chakra-ui/react'; | ||
import cs from 'classnames'; | ||
import cx from 'clsx'; | ||
import Image from 'next/image'; | ||
import React, { useMemo } from 'react'; | ||
import s from './styles.module.scss'; | ||
import { ALLOWED_ATTRIBUTES } from '@/constants/constants'; | ||
import sanitizeHtml from 'sanitize-html'; | ||
|
||
export interface IItemCommunity { | ||
title: string; | ||
desc: string | React.ReactNode; | ||
actionText: string; | ||
actionHandle: any; | ||
actionTextSecondary?: string; | ||
actionHandleSecondary?: any; | ||
isActive?: boolean; | ||
isDone?: boolean; | ||
image: string; | ||
right: { | ||
title: string; | ||
desc: string; | ||
}; | ||
} | ||
|
||
export default function ItemCommunity({ | ||
index, | ||
content, | ||
isLoading, | ||
}: { | ||
index: number; | ||
content: IItemCommunity; | ||
isLoading?: boolean; | ||
}) { | ||
const { isActive, image } = content; | ||
|
||
const isRunning = useMemo(() => { | ||
return isActive; | ||
}, [isActive, index]); | ||
|
||
return ( | ||
<> | ||
<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" w="100%"> | ||
<div className={s.itemCommunity__title}>{content?.title}</div> | ||
{!!content?.desc && ( | ||
<div | ||
className={s.itemCommunity__desc} | ||
dangerouslySetInnerHTML={{ | ||
__html: sanitizeHtml(content?.desc as string, { | ||
allowedAttributes: ALLOWED_ATTRIBUTES, | ||
}), | ||
}} | ||
/> | ||
)} | ||
{!!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"> | ||
<div className={s.itemCommunity__point}> | ||
{content?.right.title} | ||
</div> | ||
{!!content?.desc && ( | ||
<div className={s.itemCommunity__pointNote}> | ||
{content?.right.desc} | ||
</div> | ||
)} | ||
</Flex> | ||
</Flex> | ||
</Flex> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
.itemCommunity { | ||
flex-direction: row; | ||
width: 100%; | ||
display: flex; | ||
padding: 16px; | ||
align-items: flex-start; | ||
gap: 24px; | ||
align-self: stretch; | ||
border: 1px solid rgba(255, 126, 33, 0.3); | ||
background: rgba(255, 126, 33, 0.06); | ||
|
||
&.isDone { | ||
opacity: 40%; | ||
} | ||
|
||
&__title { | ||
color: #000; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 26px; | ||
} | ||
&__desc { | ||
color: #000; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 26px; | ||
opacity: 0.7; | ||
span { | ||
font-weight: 700; | ||
} | ||
} | ||
&__point { | ||
color: #000; | ||
text-align: right; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 26px; | ||
white-space: pre; | ||
} | ||
&__pointNote { | ||
color: #000; | ||
text-align: right; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 26px; | ||
opacity: 0.7; | ||
white-space: pre; | ||
} | ||
&__btnCTA { | ||
display: flex; | ||
width: 100% !important; | ||
max-width: 350px !important; | ||
height: 48px !important; | ||
padding: 16px 40px !important; | ||
justify-content: center !important; | ||
align-items: center !important; | ||
gap: 8px !important; | ||
background: #fa4e0e !important; | ||
border-radius: 0 !important; | ||
font-weight: 500 !important; | ||
color: #ffffff !important; | ||
} | ||
|
||
&__btnSecondary { | ||
background: white !important; | ||
color: black !important; | ||
} | ||
&__btnCTA:hover { | ||
opacity: 0.8; | ||
} | ||
|
||
&__logo { | ||
@include is-mobile { | ||
display: none; | ||
} | ||
} | ||
} | ||
|
||
.modalContent { | ||
border-radius: 0px !important; | ||
min-width: unset !important; | ||
} |
Oops, something went wrong.