1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +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

@ -19,17 +19,17 @@ export function Icon(props: Props) {
width = toAttributeSize(width) width = toAttributeSize(width)
height = toAttributeSize(height) height = toAttributeSize(height)
const style = { const style = {
'width': '1em', width: '1em',
'height': '1em', height: '1em',
'stroke': 'currentcolor', stroke: 'currentcolor',
'strokeWidth': 'var(--border-width)', strokeWidth: 'var(--border-width)',
'strokeLinecap': 'round', strokeLinecap: 'round',
'strokeLinejoin': 'round', strokeLinejoin: 'round',
'fill': 'none', fill: 'none',
'verticalAlign': 'baseline' 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.Icon>
</Select.Trigger> </Select.Trigger>
{/* @ts-expect-error-next-line: style actually is passed through and is needed in our case */}
<Select.Portal style={{ zIndex: 10 }}> <Select.Portal style={{ zIndex: 10 }}>
<Select.Content className="SelectContent"> <Select.Content className="SelectContent">
<Select.ScrollUpButton className="SelectScrollButton"> <Select.ScrollUpButton className="SelectScrollButton">

View File

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

View File

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