-
Notifications
You must be signed in to change notification settings - Fork 101
/
index.tsx
36 lines (32 loc) · 1.22 KB
/
index.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
import * as styledEl from './styled'
import { TradeWidgetForm } from './TradeWidgetForm'
import { TradeWidgetModals } from './TradeWidgetModals'
import { TradeWidgetUpdaters } from './TradeWidgetUpdaters'
import { TradeWidgetProps } from './types'
export const TradeWidgetContainer = styledEl.Container
export function TradeWidget(props: TradeWidgetProps) {
const { id, slots, params, confirmModal, genericModal } = props
const {
disableQuotePolling = false,
disableNativeSelling = false,
tradeQuoteStateOverride,
enableSmartSlippage,
} = params
const modals = TradeWidgetModals({confirmModal, genericModal, selectTokenWidget: slots.selectTokenWidget})
return (
<>
<styledEl.Container id={id}>
<TradeWidgetUpdaters
disableQuotePolling={disableQuotePolling}
disableNativeSelling={disableNativeSelling}
tradeQuoteStateOverride={tradeQuoteStateOverride}
enableSmartSlippage={enableSmartSlippage}
onChangeRecipient={props.actions.onChangeRecipient}
>
{slots.updaters}
</TradeWidgetUpdaters>
<styledEl.Container>{modals || <TradeWidgetForm {...props} />}</styledEl.Container>
</styledEl.Container>
</>
)
}