aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-30 10:42:25 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-30 10:42:25 +0800
commitf1354632a1a2915159f6d662f90b68fe8c3bab38 (patch)
tree4e57ab37fb4622520b5ca94f5a9f60ef91dbba8d /packages/website/ts/components
parent7fe27e903b9c66b6b0ac18be5ae1ae565f206cf4 (diff)
downloaddexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.tar
dexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.tar.gz
dexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.tar.bz2
dexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.tar.lz
dexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.tar.xz
dexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.tar.zst
dexon-sol-tools-f1354632a1a2915159f6d662f90b68fe8c3bab38.zip
feat: implement available token fetching
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/ui/multi_select.tsx13
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;
}