Skip to content

Commit

Permalink
fix: add correct values to example (#181)
Browse files Browse the repository at this point in the history
* fix: add correct values to example

* assert TradeType on useOption
  • Loading branch information
JFrankfurt authored Aug 30, 2022
1 parent 140dd5f commit fe7173c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/cosmos/ControlledSwap.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tokens } from '@uniswap/default-token-list'
import { Currency, TradeType } from '@uniswap/sdk-core'
import { SupportedChainId, SwapWidget } from '@uniswap/widgets'
import { Field, SupportedChainId, SwapWidget } from '@uniswap/widgets'
import Row from 'components/Row'
import { useCallback, useState } from 'react'
import { useValue } from 'react-cosmos/fixture'
Expand All @@ -26,7 +26,8 @@ function Fixture() {
'Exact Input': TradeType.EXACT_INPUT,
'Exact Output': TradeType.EXACT_OUTPUT,
},
})
}) as TradeType

const [amount] = useValue('amount', { defaultValue: '0' })
const currencies: Record<string, Currency> = {
ETH: nativeOnChain(SupportedChainId.MAINNET),
Expand All @@ -44,8 +45,8 @@ function Fixture() {
value={{
type,
amount,
inputToken,
outputToken,
[Field.INPUT]: inputToken,
[Field.OUTPUT]: outputToken,
}}
onSettingsReset={useHandleEvent('onSettingsReset')}
onSlippageChange={useHandleEvent('onSlippageChange')}
Expand Down

1 comment on commit fe7173c

@vercel
Copy link

@vercel vercel bot commented on fe7173c Aug 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

widgets – ./

widgets-uniswap.vercel.app
widgets-git-main-uniswap.vercel.app
widgets-seven-tau.vercel.app

Please sign in to comment.