-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add wallet donation * Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: review from code rabbit --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
878dc66
commit 28e8a9b
Showing
8 changed files
with
262 additions
and
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
SHOW_VERSION="" | ||
LANGUAGE="" | ||
NEXT_PUBLIC_GA_TRACKING_ID= | ||
|
||
WALLET_ADDRESS="" | ||
|
||
BOT_INVITATION_URL="" | ||
|
||
DISCORD_SERVER_URL="" | ||
DOCS_URL="" |
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,65 @@ | ||
import { CopyIcon } from '@chakra-ui/icons'; | ||
import { | ||
Flex, | ||
IconButton, | ||
Kbd, | ||
Modal, | ||
ModalBody, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalFooter, | ||
ModalHeader, | ||
ModalOverlay, | ||
Text, | ||
useClipboard, | ||
} from '@chakra-ui/react'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { FaCheck } from 'react-icons/fa'; | ||
|
||
interface DonationModalProps { | ||
walletAddress: string; | ||
modal: { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
}; | ||
} | ||
|
||
function DonationModal(props: DonationModalProps) { | ||
const { | ||
walletAddress, | ||
modal: { isOpen, onClose }, | ||
} = props; | ||
const { t } = useTranslation(); | ||
const { onCopy, hasCopied } = useClipboard(walletAddress); | ||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader>{t('common:home.donate.title')}</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<Flex gap='16px' flexDirection='column'> | ||
{t('common:home.donate.modal', { returnObjects: true }).map( | ||
(item) => ( | ||
<Text key={`donate-modal-${item}`}>{item}</Text> | ||
), | ||
)} | ||
<Flex gap='8px' flexDirection='row'> | ||
<Kbd px='4px' alignContent='center' w='100%'> | ||
eth: {walletAddress} | ||
</Kbd> | ||
<IconButton | ||
aria-label='Copy Address' | ||
icon={hasCopied ? <FaCheck /> : <CopyIcon />} | ||
onClick={onCopy} | ||
/> | ||
</Flex> | ||
</Flex> | ||
</ModalBody> | ||
<ModalFooter /> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
export default DonationModal; |
Oops, something went wrong.