-
Notifications
You must be signed in to change notification settings - Fork 89
/
index.tsx
30 lines (26 loc) · 1.08 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
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 } = params
const modals = TradeWidgetModals(confirmModal, genericModal)
return (
<>
<styledEl.Container id={id}>
<TradeWidgetUpdaters
disableQuotePolling={disableQuotePolling}
disableNativeSelling={disableNativeSelling}
tradeQuoteStateOverride={tradeQuoteStateOverride}
onChangeRecipient={props.actions.onChangeRecipient}
>
{slots.updaters}
</TradeWidgetUpdaters>
<styledEl.Container>{modals || <TradeWidgetForm {...props} />}</styledEl.Container>
</styledEl.Container>
</>
)
}