This repository has been archived by the owner on Feb 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
TokenPair.tsx
57 lines (47 loc) 路 1.52 KB
/
TokenPair.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React from 'react'
import { storiesOf } from '@storybook/react'
import { object, boolean } from '@storybook/addon-knobs'
import { decorateAction } from '@storybook/addon-actions'
import TokenPair from 'components/TokenPair'
import { generateTokenBalances, generateTokenPair, makeCenterDecorator } from './helpers'
const codePair = generateTokenPair()
const tokenBalances = generateTokenBalances()
const CenterDecor = makeCenterDecorator({
style: {
width: 650,
height: null,
backgroundColor: null,
},
})
const getModFromArgs = decorateAction([
args => [args[0].mod],
])
const tokenPair = () => {
const { sell, buy } = object('tokenPair', codePair)
const { [sell.address]: sellTokenBalance, [buy.address]: buyTokenBalance } = object('tokenBalances', tokenBalances)
return (
<TokenPair
openOverlay={getModFromArgs('OPEN OVERLAY to select a token to')}
sellToken={sell}
buyToken={buy}
sellTokenBalance={sellTokenBalance}
buyTokenBalance={buyTokenBalance}
swapTokensInAPairAndReCalcClosingPrice={() => {}}
resetTokenPair={() => {}}
needsTokens={boolean('needsTokens', false)}
resettable={boolean('resettable', false)}
/>
)
}
storiesOf('TokenPair', module)
.addDecorator(CenterDecor)
.addWithJSX('HOME', () => (
<div className="tokenIntro" style={{ width: 540, backgroundColor: 'white', margin: 'auto' }}>
{tokenPair()}
</div>
))
.addWithJSX('PANEL 2', () => (
<div className="auctionContainer">
{tokenPair()}
</div>
))