diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-30 10:42:25 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 18:56:11 +0800 |
commit | cc235aac3866c44a7b27bb0343390224a02b8c55 (patch) | |
tree | a3161e0f1cf6265a64c7d53bd9dd44cc75afb12f /packages/website/ts/components | |
parent | ec24bf84019ef16c32149040d096e436442828b8 (diff) | |
download | dexon-0x-contracts-cc235aac3866c44a7b27bb0343390224a02b8c55.tar.gz dexon-0x-contracts-cc235aac3866c44a7b27bb0343390224a02b8c55.tar.zst dexon-0x-contracts-cc235aac3866c44a7b27bb0343390224a02b8c55.zip |
feat: implement available token fetching
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r-- | packages/website/ts/components/ui/multi_select.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/website/ts/components/ui/multi_select.tsx b/packages/website/ts/components/ui/multi_select.tsx index 329e76bd5..bf80443af 100644 --- a/packages/website/ts/components/ui/multi_select.tsx +++ b/packages/website/ts/components/ui/multi_select.tsx @@ -10,7 +10,7 @@ import { Text } from './text'; export interface MultiSelectItemConfig { value: string; - displayText: string; + displayText: React.ReactNode; onClick?: () => void; } @@ -27,11 +27,16 @@ export class MultiSelect extends React.Component<MultiSelectProps> { textColor: colors.darkGrey, }; public render(): React.ReactNode { - const { items, backgroundColor } = this.props; + const { items, backgroundColor, selectedValues } = this.props; return ( <Container backgroundColor={backgroundColor} borderRadius="4px"> {_.map(items, item => ( - <MultiSelectItem key={item.value} displayText={item.displayText} onClick={item.onClick} /> + <MultiSelectItem + key={item.value} + displayText={item.displayText} + onClick={item.onClick} + isSelected={_.includes(selectedValues, item.value)} + /> ))} </Container> ); @@ -39,7 +44,7 @@ export class MultiSelect extends React.Component<MultiSelectProps> { } export interface MultiSelectItemProps { - displayText: string; + displayText: React.ReactNode; isSelected?: boolean; onClick?: () => void; } |