1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 01:46:51 +01:00
This commit is contained in:
Matthias Kretschmann 2023-10-29 15:33:05 +00:00
parent 74f89bcb7e
commit 74afc8552b
Signed by: m
GPG Key ID: 606EEEF3C479A91F
46 changed files with 62 additions and 122 deletions

134
package-lock.json generated
View File

@ -16,10 +16,9 @@
"@coingecko/cryptoformat": "^0.6.0",
"@nanostores/query": "^0.2.4",
"@nanostores/react": "^0.7.1",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-select": "^2.0.0",
"@rainbow-me/rainbowkit": "^1.1.3",
"astro": "3.3.4",
"astro": "3.4.0",
"astro-expressive-code": "^0.26.2",
"astro-redirect-from": "^1.0.4",
"date-fns": "^2.30.0",
@ -35,7 +34,7 @@
"react-dom": "^18.2.0",
"slugify": "^1.6.6",
"use-debounce": "^9.0.4",
"viem": "^1.16.6",
"viem": "^1.18.0",
"wagmi": "^1.4.5"
},
"devDependencies": {
@ -2351,67 +2350,6 @@
}
}
},
"node_modules/@radix-ui/react-popover": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.7.tgz",
"integrity": "sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==",
"dependencies": {
"@babel/runtime": "^7.13.10",
"@radix-ui/primitive": "1.0.1",
"@radix-ui/react-compose-refs": "1.0.1",
"@radix-ui/react-context": "1.0.1",
"@radix-ui/react-dismissable-layer": "1.0.5",
"@radix-ui/react-focus-guards": "1.0.1",
"@radix-ui/react-focus-scope": "1.0.4",
"@radix-ui/react-id": "1.0.1",
"@radix-ui/react-popper": "1.1.3",
"@radix-ui/react-portal": "1.0.4",
"@radix-ui/react-presence": "1.0.1",
"@radix-ui/react-primitive": "1.0.3",
"@radix-ui/react-slot": "1.0.2",
"@radix-ui/react-use-controllable-state": "1.0.1",
"aria-hidden": "^1.1.1",
"react-remove-scroll": "2.5.5"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0",
"react-dom": "^16.8 || ^17.0 || ^18.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
}
},
"node_modules/@radix-ui/react-popover/node_modules/react-remove-scroll": {
"version": "2.5.5",
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
"integrity": "sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==",
"dependencies": {
"react-remove-scroll-bar": "^2.3.3",
"react-style-singleton": "^2.2.1",
"tslib": "^2.1.0",
"use-callback-ref": "^1.3.0",
"use-sidecar": "^1.1.2"
},
"engines": {
"node": ">=10"
},
"peerDependencies": {
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
}
},
"node_modules/@radix-ui/react-popper": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.1.3.tgz",
@ -2467,30 +2405,6 @@
}
}
},
"node_modules/@radix-ui/react-presence": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.1.tgz",
"integrity": "sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==",
"dependencies": {
"@babel/runtime": "^7.13.10",
"@radix-ui/react-compose-refs": "1.0.1",
"@radix-ui/react-use-layout-effect": "1.0.1"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0",
"react-dom": "^16.8 || ^17.0 || ^18.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
}
},
"node_modules/@radix-ui/react-primitive": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz",
@ -5367,9 +5281,9 @@
}
},
"node_modules/astro": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/astro/-/astro-3.3.4.tgz",
"integrity": "sha512-1yy1p8/QpACpToK2bYFxbbPug7+HeUW+IGvkIss2KQDv4pwDk19UbfQrS8aMHtW3nvR7PpBYL/H/Dprcqxy40A==",
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/astro/-/astro-3.4.0.tgz",
"integrity": "sha512-nTOFxrPOnmACl8noTPkRJkaEOMx4wZy4QCLB2aDL3Lm+AiEaVcgH7YQ4GpCl72zSNXp/A7hGdUgcXbC4XYHOCQ==",
"dependencies": {
"@astrojs/compiler": "^2.1.0",
"@astrojs/internal-helpers": "0.2.1",
@ -5408,6 +5322,7 @@
"mime": "^3.0.0",
"ora": "^7.0.1",
"p-limit": "^4.0.0",
"p-queue": "^7.4.1",
"path-to-regexp": "^6.2.1",
"preferred-pm": "^3.1.2",
"probe-image-size": "^7.2.3",
@ -14163,6 +14078,37 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-queue": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.4.1.tgz",
"integrity": "sha512-vRpMXmIkYF2/1hLBKisKeVYJZ8S2tZ0zEAmIJgdVKP2nq0nh4qCdf8bgw+ZgKrkh71AOCaqzwbJJk1WtdcF3VA==",
"dependencies": {
"eventemitter3": "^5.0.1",
"p-timeout": "^5.0.2"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-queue/node_modules/eventemitter3": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA=="
},
"node_modules/p-timeout": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz",
"integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
@ -19337,9 +19283,9 @@
"integrity": "sha512-d0XxK3YTObnWVp6rZuev3c49+j4Lo8g4L1ZRm9z5L0xpoZycUPshHgczK5gsUMaZOstjVYYi09p5gYvUtfChYw=="
},
"node_modules/viem": {
"version": "1.16.6",
"resolved": "https://registry.npmjs.org/viem/-/viem-1.16.6.tgz",
"integrity": "sha512-jcWcFQ+xzIfDwexwPJRvCuCRJKEkK9iHTStG7mpU5MmuSBpACs4nATBDyXNFtUiyYTFzLlVEwWkt68K0nCSImg==",
"version": "1.18.0",
"resolved": "https://registry.npmjs.org/viem/-/viem-1.18.0.tgz",
"integrity": "sha512-NeKi5RFj7fHdsnk5pojivHFLkTyBWyehxeSE/gSPTDJKCWnR9i+Ra0W++VwN5ghciEG55O8b4RdpYhzGmhnr7A==",
"funding": [
{
"type": "github",

View File

@ -49,10 +49,9 @@
"@coingecko/cryptoformat": "^0.6.0",
"@nanostores/query": "^0.2.4",
"@nanostores/react": "^0.7.1",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-select": "^2.0.0",
"@rainbow-me/rainbowkit": "^1.1.3",
"astro": "3.3.4",
"astro": "3.4.0",
"astro-expressive-code": "^0.26.2",
"astro-redirect-from": "^1.0.4",
"date-fns": "^2.30.0",
@ -68,7 +67,7 @@
"react-dom": "^18.2.0",
"slugify": "^1.6.6",
"use-debounce": "^9.0.4",
"viem": "^1.16.6",
"viem": "^1.18.0",
"wagmi": "^1.4.5"
},
"devDependencies": {

View File

@ -1,6 +1,6 @@
---
import Menu from '@components/Menu/index.astro'
import Search from '@components/Search/index.astro'
import Search from '@features/Search/index.astro'
import ThemeSwitch from '@components/ThemeSwitch/index.astro'
import { Logo } from '@images/components'
import styles from './index.module.css'

View File

@ -1,9 +1,9 @@
import { test, expect } from 'vitest'
import { render, fireEvent, screen, waitFor } from '@testing-library/react'
import Web3Donation from '.'
import Web3Form from '.'
test('Web3Donation component', async () => {
render(<Web3Donation address="0x456" />)
render(<Web3Form />)
const submitButton = screen.getByRole('button')
expect(submitButton).toBeInTheDocument()

View File

@ -2,13 +2,13 @@ import { type ReactElement, useState, useEffect } from 'react'
import { useDebounce } from 'use-debounce'
import { useAccount } from 'wagmi'
import { ConnectButton } from '@rainbow-me/rainbowkit'
import Alert, { getTransactionMessage } from './components/Alert/Alert'
import { InputGroup } from './components/Input'
import Alert, { getTransactionMessage } from '../Alert/Alert'
import { InputGroup } from '../Input'
import styles from './index.module.css'
import { SendNative, SendErc20 } from './components/Send'
import type { GetToken } from './hooks/useTokens'
import { SendNative, SendErc20 } from '../Send'
import type { GetToken } from '../../hooks/useTokens'
export default function Web3Donation(): ReactElement {
export default function Web3Form(): ReactElement {
const { address: account } = useAccount()
const [amount, setAmount] = useState('')

View File

@ -6,13 +6,6 @@
display: flex;
}
/* @media (min-width: 40rem) {
.inputGroup {
display: flex;
flex-wrap: wrap;
}
} */
.token {
width: 80px;
background: var(--box-background-color);
@ -66,12 +59,13 @@
}
.message {
composes: message from '../../index.module.css';
composes: message from '../Form/index.module.css';
}
.disclaimer {
font-size: var(--font-size-mini);
color: var(--text-color-light);
margin-top: calc(var(--spacer) / 3);
}
.disclaimer code {

View File

@ -2,10 +2,9 @@ import * as Select from '@radix-ui/react-select'
import './TokenSelect.css'
import { Token } from './Token'
import { ChevronDown, ChevronsDown, ChevronsUp } from '@images/components/react'
import { useTokens } from '../../hooks/useTokens/useTokens'
import { TokenLoading } from './TokenLoading'
import { useEffect } from 'react'
import type { GetToken } from '../../hooks/useTokens'
import { useTokens, type GetToken } from '../../hooks/useTokens'
import { useAccount, useNetwork } from 'wagmi'
export function TokenSelect({

View File

@ -1,14 +1,13 @@
import Web3Donation from './Web3Donation'
import { RainbowKitProvider } from '@rainbow-me/rainbowkit'
import { WagmiConfig } from 'wagmi'
import { wagmiConfig, chains, theme } from './Web3Donation/lib/rainbowkit'
import type { ReactElement } from 'react'
import { wagmiConfig, chains, theme } from '../lib/rainbowkit'
import Web3Form from './Form'
export default function Web3(): ReactElement {
export function Web3() {
return (
<WagmiConfig config={wagmiConfig}>
<RainbowKitProvider chains={chains} theme={theme}>
<Web3Donation />
<Web3Form />
</RainbowKitProvider>
</WagmiConfig>
)

View File

@ -0,0 +1 @@
export * from './components/Web3'

View File

@ -1,9 +1,9 @@
---
import BackButton from '@components/BackButton.astro'
import LayoutBase from '@layouts/Base/index.astro'
import Web3 from '@components/Sponsor/Web3'
import { Web3 } from '@features/Web3'
import config from '@config/blog.config'
import Coin from '@components/Sponsor/Coin.astro'
import Coin from '@components/Coin.astro'
const coins = Object.entries(config.author).filter(
([key]) => key === 'bitcoin' || key === 'ether'
@ -51,3 +51,4 @@ const coins = Object.entries(config.author).filter(
}
</div>
</LayoutBase>
@components/Sponsor/Web3/Web3 @components/Web3

View File

@ -7,6 +7,7 @@
"paths": {
"@config/*": [".config/*"],
"@components/*": ["src/components/*"],
"@features/*": ["src/features/*"],
"@layouts/*": ["src/layouts/*"],
"@images/*": ["src/images/*"],
"@lib/*": ["src/lib/*"],