Skip to content

Commit

Permalink
Fixing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
corbanbrook committed Apr 23, 2024
1 parent 2b400d2 commit bee03eb
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 160 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"@types/node": "^18.11.17",
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vanilla-extract/babel-plugin": "^1.2.0",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/kit/src/utils/genericContext.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react'
import { useContext, createContext } from 'react'

// https://medium.com/@rivoltafilippo/typing-react-context-to-avoid-an-undefined-default-value-2c7c5a7d5947

export const createGenericContext = <T extends unknown>() => {
export const createGenericContext = <T,>() => {
// Create a context with a generic parameter or undefined
const genericContext = React.createContext<T | undefined>(undefined)
const genericContext = createContext<T | undefined>(undefined)

// Check if the value provided to the context is defined or throw an error
const useGenericContext = () => {
const contextIsDefined = React.useContext(genericContext)
const contextIsDefined = useContext(genericContext)
if (!contextIsDefined) {
throw new Error('useGenericContext must be used within a Provider')
}
Expand Down
1 change: 0 additions & 1 deletion packages/wallet/src/shared/SelectButton/SelectButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { BoxProps, Card } from '@0xsequence/design-system'
import { clsx } from 'clsx'
import { ReactNode } from 'react'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const TransactionHistoryItem = ({ transaction }: TransactionHistoryItemPr
})
}

let tokenContractAddresses: string[] = []
const tokenContractAddresses: string[] = []

transaction.transfers?.forEach(transfer => {
const tokenContractAddress = transfer.contractAddress
Expand Down
8 changes: 4 additions & 4 deletions packages/wallet/src/utils/genericContext.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react'
import { createContext, useContext } from 'react'

// https://medium.com/@rivoltafilippo/typing-react-context-to-avoid-an-undefined-default-value-2c7c5a7d5947

export const createGenericContext = <T extends unknown>() => {
export const createGenericContext = <T,>() => {
// Create a context with a generic parameter or undefined
const genericContext = React.createContext<T | undefined>(undefined)
const genericContext = createContext<T | undefined>(undefined)

// Check if the value provided to the context is defined or throw an error
const useGenericContext = () => {
const contextIsDefined = React.useContext(genericContext)
const contextIsDefined = useContext(genericContext)
if (!contextIsDefined) {
throw new Error('useGenericContext must be used within a Provider')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import React from 'react'
import { ethers } from 'ethers'
import { useConfig } from 'wagmi'
import { Box } from '@0xsequence/design-system'
import { TokenBalance } from '@0xsequence/indexer'
import { useContractInfo } from '../../../../../hooks'

import { CoinTileContent } from './CoinTileContent'

import { getNativeTokenInfoByChainId } from '@0xsequence/kit'

import { computeBalanceFiat, formatDisplay, getPercentagePriceChange, compareAddress } from '../../../../../utils'

import { useCoinPrices, useConversionRate, useSettings } from '../../../../../hooks'
import { useContractInfo, useCoinPrices, useConversionRate, useSettings } from '../../../../../hooks'

interface CoinTileProps {
balance: TokenBalance
Expand Down
Loading

0 comments on commit bee03eb

Please sign in to comment.