1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 09:56:51 +01:00

fix all type errors

This commit is contained in:
Matthias Kretschmann 2023-11-01 22:16:02 +00:00
parent 9124ecfb82
commit 67c4aa1ea2
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 22 additions and 14 deletions

View File

@ -20,16 +20,16 @@ export function Icon(props: Props) {
height = toAttributeSize(height)
const style = {
'width': '1em',
'height': '1em',
'stroke': 'currentcolor',
'strokeWidth': 'var(--border-width)',
'strokeLinecap': 'round',
'strokeLinejoin': 'round',
'fill': 'none',
'verticalAlign': 'baseline'
width: '1em',
height: '1em',
stroke: 'currentcolor',
strokeWidth: 'var(--border-width)',
strokeLinecap: 'round',
strokeLinejoin: 'round',
fill: 'none',
verticalAlign: 'baseline'
}
return <svg width={width} height={height} fill="none" viewBox="0 0 24 24" {...props} style={style}>{title ? (<title>{title}</title>) : ''}${innerSVG}</svg>
return <svg width={width} height={height} fill="none" viewBox="0 0 24 24" {...props} style={style as any}>{title ? (<title>{title}</title>) : ''}${innerSVG}</svg>
}
`

View File

@ -45,6 +45,7 @@ export function TokenSelect() {
</Select.Icon>
</Select.Trigger>
{/* @ts-expect-error-next-line: style actually is passed through and is needed in our case */}
<Select.Portal style={{ zIndex: 10 }}>
<Select.Content className="SelectContent">
<Select.ScrollUpButton className="SelectScrollButton">

View File

@ -2,10 +2,11 @@ import { useEffect, useState } from 'react'
import useSWR from 'swr'
import type { GetToken } from '@features/Web3/stores/tokens'
import { useNetwork, useAccount } from 'wagmi'
import { fetcher } from '@stores/fetcher'
import { $setTokens } from '@features/Web3/stores/tokens'
import { $setSelectedToken } from '@features/Web3/stores/selectedToken'
const fetcher = (url: string) => fetch(url).then((res) => res.json())
//
// Wrapper for fetching user tokens with swr.
//

View File

@ -1,6 +1,8 @@
import { nanoquery } from '@nanostores/query'
import { type Fetcher, nanoquery } from '@nanostores/query'
export async function fetcher(...args: (string | number)[]) {
export const fetcher: Fetcher<unknown> = async (
...args: any[]
): Promise<unknown> => {
const res = await fetch(args.join(''))
return await res.json()
}

View File

@ -17,7 +17,11 @@
},
"typeRoots": ["./src/@types", "./node_modules/@types"]
},
"exclude": ["src/images/components", "src/content"],
"exclude": [
"src/images/components/**/*",
"src/content",
"scripts/create-icons/tmp/"
],
"include": [
"src/**/*",
"content/**/*",