Browse Source

chore(web): update crypto addresses

pull/48/head
isra el 1 year ago
parent
commit
b41262f5d3
  1. 46
      web/app/(app)/contribute/page.tsx
  2. 65
      web/app/(landing-page)/(components)/support-project-section.tsx
  3. 82
      web/components/shared/contribute-modal.tsx
  4. 34
      web/lib/constants.ts
  5. 31
      web/public/crypto/btc.svg
  6. 11
      web/public/crypto/eth.svg
  7. 17
      web/public/crypto/sol.svg
  8. 17
      web/public/crypto/usdt.svg
  9. 13
      web/public/crypto/xmr.svg

46
web/app/(app)/contribute/page.tsx

@ -30,35 +30,8 @@ import {
DialogTitle, DialogTitle,
DialogTrigger, DialogTrigger,
} from '@/components/ui/dialog' } from '@/components/ui/dialog'
const cryptoWallets = [
{
name: 'Bitcoin (BTC)',
address: 'bc1qhffsnhp8ynqy6xvh982cu0x5w7vguuum3nqae9',
network: 'Bitcoin',
},
{
name: 'Ethereum (ETH)',
address: '0xDB8560a42bdaa42C58462C6b2ee5A7D36F1c1f2a',
network: 'Ethereum (ERC20)',
},
{
name: 'Tether (USDT)',
address: '0xDB8560a42bdaa42C58462C6b2ee5A7D36F1c1f2a',
network: 'Ethereum (ERC20)',
},
// {
// name: 'Tether (USDT)',
// address: 'TD6txzY61D6EgnVfMLPsqKhYfyV5iHrbkw',
// network: 'Tron (TRC20)',
// },
{
name: 'Monero (XMR)',
address:
'856J5eHJM7bgBhkc51oCuMYUGKvUvF1zwAWrQsqwuH1shG9qnX4YkoZbMmhCPep1JragY2W1hpzAnDda6BXvCgZxUJhUyTg',
network: 'Monero (XMR)',
},
]
import { CRYPTO_ADDRESSES } from '@/lib/constants'
import Image from 'next/image'
export default function ContributePage() { export default function ContributePage() {
const { toast } = useToast() const { toast } = useToast()
@ -153,17 +126,16 @@ export default function ContributePage() {
</DialogTitle> </DialogTitle>
</DialogHeader> </DialogHeader>
<div className='space-y-4'> <div className='space-y-4'>
{cryptoWallets.map((wallet, index) => (
{CRYPTO_ADDRESSES.map((wallet, index) => (
<div key={index} className='space-y-2'> <div key={index} className='space-y-2'>
<div className='flex items-center justify-between'> <div className='flex items-center justify-between'>
<span className='flex items-center gap-2'> <span className='flex items-center gap-2'>
{wallet.name.includes('Bitcoin') ? (
<Bitcoin className='h-4 w-4' />
) : wallet.name.includes('Ethereum') ? (
<Coins className='h-4 w-4' />
) : (
<Wallet className='h-4 w-4' />
)}{' '}
<Image
src={wallet.icon}
alt={wallet.name}
width={32}
height={32}
/>
{wallet.name} {wallet.name}
</span> </span>
<Button <Button

65
web/app/(landing-page)/(components)/support-project-section.tsx

@ -12,40 +12,12 @@ import {
} from '../../../components/ui/dialog' } from '../../../components/ui/dialog'
import Link from 'next/link' import Link from 'next/link'
import { ExternalLinks } from '@/config/external-links' import { ExternalLinks } from '@/config/external-links'
import { CRYPTO_ADDRESSES } from '@/lib/constants'
import Image from 'next/image'
export default function SupportProjectSection() { export default function SupportProjectSection() {
const [cryptoOpen, setCryptoOpen] = useState(false) const [cryptoOpen, setCryptoOpen] = useState(false)
const [copiedAddress, setCopiedAddress] = useState('') const [copiedAddress, setCopiedAddress] = useState('')
const cryptoWallets = [
{
name: 'Bitcoin (BTC)',
address: 'bc1qhffsnhp8ynqy6xvh982cu0x5w7vguuum3nqae9',
network: 'Bitcoin',
},
{
name: 'Ethereum (ETH)',
address: '0xDB8560a42bdaa42C58462C6b2ee5A7D36F1c1f2a',
network: 'Ethereum (ERC20)',
},
{
name: 'Tether (USDT)',
address: '0xDB8560a42bdaa42C58462C6b2ee5A7D36F1c1f2a',
network: 'Ethereum (ERC20)',
},
// {
// name: 'Tether (USDT)',
// address: 'TD6txzY61D6EgnVfMLPsqKhYfyV5iHrbkw',
// network: 'Tron (TRC20)',
// },
{
name: 'Monero (XMR)',
address:
'856J5eHJM7bgBhkc51oCuMYUGKvUvF1zwAWrQsqwuH1shG9qnX4YkoZbMmhCPep1JragY2W1hpzAnDda6BXvCgZxUJhUyTg',
network: 'Monero (XMR)',
},
]
const copyToClipboard = (address: string) => { const copyToClipboard = (address: string) => {
navigator.clipboard.writeText(address) navigator.clipboard.writeText(address)
setCopiedAddress(address) setCopiedAddress(address)
@ -99,23 +71,34 @@ export default function SupportProjectSection() {
<DialogHeader> <DialogHeader>
<DialogTitle>Donate Cryptocurrency</DialogTitle> <DialogTitle>Donate Cryptocurrency</DialogTitle>
</DialogHeader> </DialogHeader>
<div className='grid gap-4 py-4'>
{cryptoWallets.map((wallet, index) => (
<div className='grid gap-2 py-2'>
{CRYPTO_ADDRESSES.map((wallet, index) => (
<div <div
key={index} key={index}
className='flex items-center justify-between p-4 rounded-lg bg-gray-100 dark:bg-muted'
className='flex items-center justify-between p-2 rounded-lg bg-gray-100 dark:bg-muted'
> >
<div>
<h4 className='font-semibold'>{wallet.name}</h4>
<p className='text-sm text-gray-500'>{wallet.network}</p>
<p className='text-xs text-gray-400 mt-1 break-all'>
{wallet.address}
</p>
<div className='flex items-center gap-2'>
<Image
src={wallet.icon}
alt={wallet.name}
width={24}
height={24}
/>
<div>
<div className='flex items-center gap-2'>
<h4 className='font-medium text-sm'>{wallet.name}</h4>
<span className='text-xs text-gray-500'>({wallet.network})</span>
</div>
<p className='text-xs text-gray-400 break-all'>
{wallet.address}
</p>
</div>
</div> </div>
<Button <Button
variant='outline'
size='icon'
variant='ghost'
size='sm'
onClick={() => copyToClipboard(wallet.address)} onClick={() => copyToClipboard(wallet.address)}
className='h-8 w-8'
> >
{copiedAddress === wallet.address ? ( {copiedAddress === wallet.address ? (
<Check className='h-4 w-4' /> <Check className='h-4 w-4' />

82
web/components/shared/contribute-modal.tsx

@ -23,6 +23,8 @@ import {
} from 'lucide-react' } from 'lucide-react'
import Link from 'next/link' import Link from 'next/link'
import { ExternalLinks } from '@/config/external-links' import { ExternalLinks } from '@/config/external-links'
import { CRYPTO_ADDRESSES } from '@/lib/constants'
import Image from 'next/image'
// Add constants for localStorage and timing // Add constants for localStorage and timing
const STORAGE_KEYS = { const STORAGE_KEYS = {
@ -38,30 +40,6 @@ export function ContributeModal() {
const [cryptoOpen, setCryptoOpen] = useState(false) const [cryptoOpen, setCryptoOpen] = useState(false)
const [copiedAddress, setCopiedAddress] = useState('') const [copiedAddress, setCopiedAddress] = useState('')
const cryptoWallets = [
{
name: 'Bitcoin (BTC)',
address: 'bc1qhffsnhp8ynqy6xvh982cu0x5w7vguuum3nqae9',
network: 'Bitcoin',
},
{
name: 'Ethereum (ETH)',
address: '0xDB8560a42bdaa42C58462C6b2ee5A7D36F1c1f2a',
network: 'Ethereum (ERC20)',
},
{
name: 'Tether (USDT)',
address: '0xDB8560a42bdaa42C58462C6b2ee5A7D36F1c1f2a',
network: 'Ethereum (ERC20)',
},
{
name: 'Monero (XMR)',
address:
'856J5eHJM7bgBhkc51oCuMYUGKvUvF1zwAWrQsqwuH1shG9qnX4YkoZbMmhCPep1JragY2W1hpzAnDda6BXvCgZxUJhUyTg',
network: 'Monero (XMR)',
},
]
const copyToClipboard = (address: string) => { const copyToClipboard = (address: string) => {
navigator.clipboard.writeText(address) navigator.clipboard.writeText(address)
setCopiedAddress(address) setCopiedAddress(address)
@ -70,6 +48,9 @@ export function ContributeModal() {
useEffect(() => { useEffect(() => {
const checkAndShowModal = () => { const checkAndShowModal = () => {
setIsOpen(true)
return
const hasContributed = const hasContributed =
localStorage.getItem(STORAGE_KEYS.HAS_CONTRIBUTED) === 'true' localStorage.getItem(STORAGE_KEYS.HAS_CONTRIBUTED) === 'true'
if (hasContributed) return if (hasContributed) return
@ -184,34 +165,49 @@ export function ContributeModal() {
</Dialog> </Dialog>
<Dialog open={cryptoOpen} onOpenChange={setCryptoOpen}> <Dialog open={cryptoOpen} onOpenChange={setCryptoOpen}>
<DialogContent className='sm:max-w-[500px]'>
<DialogContent className='sm:max-w-[425px]'>
<DialogHeader> <DialogHeader>
<DialogTitle>Donate Cryptocurrency</DialogTitle> <DialogTitle>Donate Cryptocurrency</DialogTitle>
</DialogHeader> </DialogHeader>
<div className='grid gap-4 py-4'>
{cryptoWallets.map((wallet, index) => (
<div className='grid gap-2'>
{CRYPTO_ADDRESSES.map((wallet, index) => (
<div <div
key={index} key={index}
className='flex items-center justify-between p-4 rounded-lg bg-gray-100 dark:bg-muted'
className='flex gap-3 p-2 rounded-lg hover:bg-muted/50 transition-colors'
> >
<div>
<h4 className='font-semibold'>{wallet.name}</h4>
<p className='text-sm text-gray-500'>{wallet.network}</p>
<p className='text-xs text-gray-400 mt-1 break-all'>
<Image
src={wallet.icon}
alt={wallet.name}
width={32}
height={32}
className='shrink-0 mt-1'
/>
<div className='min-w-0 flex-1'>
<div className='flex items-center justify-between'>
<div>
<p className='font-medium text-sm'>{wallet.name}</p>
<p className='text-xs text-muted-foreground'>{wallet.network}</p>
</div>
<Button
variant='ghost'
size='sm'
className='h-8 px-2 shrink-0'
onClick={() => copyToClipboard(wallet.address)}
>
{copiedAddress === wallet.address ? (
<Check className='h-3.5 w-3.5' />
) : (
<Copy className='h-3.5 w-3.5' />
)}
</Button>
</div>
<p
className='text-xs text-muted-foreground break-all'
title={wallet.address}
>
{wallet.address} {wallet.address}
</p> </p>
</div> </div>
<Button
variant='outline'
size='icon'
onClick={() => copyToClipboard(wallet.address)}
>
{copiedAddress === wallet.address ? (
<Check className='h-4 w-4' />
) : (
<Copy className='h-4 w-4' />
)}
</Button>
</div> </div>
))} ))}
</div> </div>

34
web/lib/constants.ts

@ -1,3 +1,37 @@
export const WEBHOOK_EVENTS = { export const WEBHOOK_EVENTS = {
MESSAGE_RECEIVED: 'MESSAGE_RECEIVED', MESSAGE_RECEIVED: 'MESSAGE_RECEIVED',
} as const } as const
export const CRYPTO_ADDRESSES = [
{
name: 'Bitcoin (BTC)',
address: 'bc1q3zt8fc48psqqlranlkn68rf5mzuyuh7vd62vs3',
network: 'Bitcoin',
icon: '/crypto/btc.svg',
},
{
name: 'Ethereum (ETH)',
address: '0x568541d7d566eB064D1e8bCd83843bF3970B92c1',
network: 'Ethereum',
icon: '/crypto/eth.svg',
},
{
name: 'Tether (USDT)',
address: '0x568541d7d566eB064D1e8bCd83843bF3970B92c1',
network: 'Ethereum (ERC-20)',
icon: '/crypto/usdt.svg',
},
{
name: 'Solana (SOL)',
address: 'C6puH6rD6D7BgbRt8NPpkD62fMnPGQvYUKDiA1eUUjGZ',
network: 'Solana',
icon: '/crypto/sol.svg',
},
{
name: 'Monero (XMR)',
address:
'856J5eHJM7bgBhkc51oCuMYUGKvUvF1zwAWrQsqwuH1shG9qnX4YkoZbMmhCPep1JragY2W1hpzAnDda6BXvCgZxUJhUyTg',
network: 'Monero',
icon: '/crypto/xmr.svg',
},
]

31
web/public/crypto/btc.svg

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 500 500" enable-background="new 0 0 500 500" xml:space="preserve">
<path fill="#F39321" d="M43.43,125.143c7.71-10.766,14.875-21.901,23.562-31.986c15.8-18.343,33.692-34.063,54.18-47.075
c18.379-11.672,37.761-20.872,58.501-27.305c32.294-10.018,65.26-12.997,98.838-9.165c24.544,2.801,48.191,9.067,70.713,19.215
c13.633,6.142,26.456,13.731,39.025,21.927c25.328,16.515,45.618,38.014,62.58,62.577c18.116,26.236,29.889,55.421,36.346,86.725
c4.535,21.983,6.449,44.171,4.503,66.504c-2.399,27.536-8.514,54.086-19.938,79.604c-9.662,21.583-21.589,41.401-36.861,59.301
c-14.94,17.511-31.788,32.831-51.149,45.461c-13.184,8.6-26.926,16.276-41.434,21.975c-24.274,9.537-49.447,15.986-75.787,17.115
c-18.545,0.795-36.985,0.483-55.279-2.763c-15.713-2.788-31.049-6.858-46.063-12.496c-14.566-5.47-28.693-11.95-41.709-20.143
c-18.766-11.812-35.683-26.147-50.737-42.663c-16.773-18.403-30.373-38.808-40.779-61.344
c-14.7-31.835-21.929-65.401-22.359-100.425c-0.162-13.173,1.349-26.244,3.105-39.283c0.126-0.933-0.002-1.899-0.012-2.851
c1.536-0.952,1.4-2.618,1.677-4.071c3.906-20.483,10.494-40.059,19.418-58.906C36.933,138.397,41.296,132.307,43.43,125.143z
M325.157,254.513c6.537-3.474,12.749-5.465,17.658-9.85c18.918-16.899,23.96-56.673-6.747-75.833
c-9.566-5.969-19.77-10.393-30.77-14.907c1.819-14.731,7.709-28.516,9.622-43.603c-9.076-2.249-17.578-5.234-26.425-6.193
c-3.617,14.177-7.085,27.769-10.674,41.837c-6.78-2.076-13.761-1.879-20.142-5.473c2.302-14.39,7.773-27.872,9.268-42.314
c-9.322-1.464-17.216-5.094-26.265-5.485c-3.563,14.209-7.011,27.958-10.586,42.215c-17.944-2.75-34.419-8.921-52.52-12.239
c-3.977,8.91-5.738,18.311-7.334,28.313c5.896,1.392,11.022,2.623,16.158,3.811c12.965,2.998,16.517,10.086,13.439,21.424
c-2.19,8.065-4.166,16.189-6.182,24.301c-7.245,29.16-14.432,58.333-21.72,87.482c-1.642,6.567-5.734,8.706-12.398,7.731
c-6.563-0.96-12.757-3.907-19.99-3.693c-3.136,10.032-9.378,18.871-11.588,29.946c17.236,4.391,33.911,8.639,51.344,13.08
c-1.312,15.208-7.614,29.125-9.476,44.441c8.739,2.095,16.965,4.066,25.544,6.123c5.653-14.044,6.957-28.803,12.226-43.33
c6.351,3.265,13.397,2.317,19.612,6.427c-3.387,14.003-6.762,27.952-10.178,42.077c8.986,3.216,17.753,4.528,26.758,6.77
c3.645-14.604,7.169-28.728,10.578-42.386c2.123-1.091,3.676-0.888,5.143-0.574c14.113,3.021,28.39,3.726,42.676,2.14
c12.368-1.373,23.343-6.088,32.148-15.372c9.791-10.323,14.71-22.952,17.078-36.535c1.93-11.065,1.436-22.277-5.06-32.071
C341.263,265.099,334.27,259.243,325.157,254.513z M223.128,312.17c17.411,4.325,34.803,8.95,53.02,5.624
c9.715-1.774,17.037-6.73,19.985-16.503c2.78-9.218,1.164-17.593-5.673-24.879c-7.11-7.576-16.254-11.514-25.682-14.807
c-11.264-3.934-22.683-7.508-34.99-8.48c-4.716,19.168-9.293,37.773-13.972,56.788C218.797,310.842,220.933,311.625,223.128,312.17z
M284.628,231.846c9.628-1.368,17.612-7.738,19.958-16.393c2.869-10.583-0.337-19.865-8.902-26.178
c-9.718-7.163-20.908-10.807-32.47-13.337c-4.307-0.943-8.544-3.454-13.756-1.759c-4.143,16.837-8.303,33.747-12.599,51.209
C253.316,229.543,268.47,234.141,284.628,231.846z"/>
</svg>

11
web/public/crypto/eth.svg

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 500 500" enable-background="new 0 0 500 500" xml:space="preserve">
<polygon fill="#2F3030" points="249.982,6.554 397.98,251.112 250.53,188.092 "/>
<polygon fill="#828384" points="102.39,251.112 249.982,6.554 250.53,188.092 "/>
<polygon fill="#343535" points="249.982,341.285 102.39,251.112 250.53,188.092 "/>
<polygon fill="#131313" points="397.98,251.112 250.53,188.092 249.982,341.285 "/>
<polygon fill="#2F3030" points="249.982,372.329 397.98,284.597 249.982,493.13 "/>
<polygon fill="#828384" points="249.982,372.329 102.39,284.597 249.982,493.13 "/>
</svg>

17
web/public/crypto/sol.svg

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="sol" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_2_);}
</style>
<path id="SVGID_1_" d="M250,0c138,0,250,111.9,250,250S388,500,250,500S0,388,0,250S111.9,0,250,0L250,0z"/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="242.5198" y1="267.3304" x2="755.6802" y2="-245.8303" gradientTransform="matrix(0.5 0 0 0.5 0 250)">
<stop offset="0" style="stop-color:#CB4EE8"/>
<stop offset="1" style="stop-color:#10F4B1"/>
</linearGradient>
<path class="st0" d="M115.6,226.1H347c2.9,0,5.6,1.1,7.6,3.2l36.6,36.8c6.8,6.8,2,18.4-7.6,18.4H152.2c-2.9,0-5.6-1.1-7.6-3.2
L108,244.5C101.2,237.8,106,226.1,115.6,226.1z M107.9,177.3l36.6-36.8c2.1-2.1,4.8-3.2,7.6-3.2h231.3c9.6,0,14.5,11.6,7.6,18.4
l-36.5,36.8c-2,2.1-4.8,3.2-7.6,3.2H115.6C106,195.7,101.2,184.1,107.9,177.3z M391.1,333.5l-36.6,36.9c-2,2-4.8,3.2-7.6,3.2H115.6
c-9.6,0-14.4-11.6-7.7-18.4l36.6-36.9c2.1-2,4.8-3.2,7.6-3.2h231.3C393.1,315,398,326.6,391.1,333.5z"/>
</svg>

17
web/public/crypto/usdt.svg

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#50AF95;}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>
<path class="st0" d="M91.5,34.7L0.4,226.2c-0.7,1.5-0.4,3.2,0.8,4.3l246.2,235.9c1.5,1.4,3.7,1.4,5.2,0l246.2-235.9
c1.2-1.1,1.5-2.9,0.8-4.3L408.5,34.7c-0.6-1.3-1.9-2.2-3.4-2.2H94.9C93.5,32.5,92.2,33.3,91.5,34.7C91.5,34.7,91.5,34.7,91.5,34.7z"
/>
<path class="st1" d="M281.6,245.8L281.6,245.8c-1.8,0.1-10.9,0.7-31.3,0.7c-16.2,0-27.7-0.5-31.7-0.7l0,0
c-62.6-2.8-109.4-13.7-109.4-26.7c0-13.1,46.7-23.9,109.4-26.7V235c4.1,0.3,15.8,1,32,1c19.4,0,29.2-0.8,30.9-1v-42.6
c62.5,2.8,109.1,13.7,109.1,26.7S344.1,243,281.6,245.8L281.6,245.8L281.6,245.8z M281.6,188v-38.1h87.2V91.8H131.4v58.1h87.2V188
c-70.9,3.3-124.2,17.3-124.2,34.1s53.3,30.8,124.2,34.1v122.1h63V256.2c70.7-3.3,123.9-17.3,123.9-34.1S352.4,191.3,281.6,188
L281.6,188L281.6,188z M281.6,188L281.6,188z"/>
</svg>

13
web/public/crypto/xmr.svg

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FF6600;}
.st1{fill:#4C4C4C;}
</style>
<path class="st0" d="M250,1.7C112.9,1.7,1.8,112.9,1.8,250c0,27.4,4.4,53.8,12.6,78.4h74.2V119.5L250,280.9l161.3-161.4v208.9h74.2
c8.2-24.7,12.6-51,12.6-78.4C498.2,112.9,387.1,1.7,250,1.7"/>
<path class="st1" d="M212.9,318l-70.4-70.4V379H37.9C81.5,450.5,160.2,498.2,250,498.2S418.5,450.5,462.1,379H357.5V247.6L287.1,318
L250,355.1L212.9,318L212.9,318L212.9,318L212.9,318z"/>
</svg>
Loading…
Cancel
Save