aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/ui
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 01:50:56 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 01:50:56 +0800
commitbe787a0fd19a658cbf21eb90140c76779647dfbc (patch)
treee3d396c6a29ebca194b29b75886c9b9b9db43e4f /packages/instant/src/components/ui
parentfdc4a4e5fa31d8797abf6313f4488147853ed77e (diff)
downloaddexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar
dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar.gz
dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar.bz2
dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar.lz
dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar.xz
dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar.zst
dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.zip
feat(instant): Add analytics events for payment dropdown
Diffstat (limited to 'packages/instant/src/components/ui')
-rw-r--r--packages/instant/src/components/ui/dropdown.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/instant/src/components/ui/dropdown.tsx b/packages/instant/src/components/ui/dropdown.tsx
index 3a23f456d..02e87d639 100644
--- a/packages/instant/src/components/ui/dropdown.tsx
+++ b/packages/instant/src/components/ui/dropdown.tsx
@@ -19,6 +19,7 @@ export interface DropdownProps {
value: string;
label?: string;
items: DropdownItemConfig[];
+ onOpen?: () => void;
}
export interface DropdownState {
@@ -97,9 +98,14 @@ export class Dropdown extends React.Component<DropdownProps, DropdownState> {
if (_.isEmpty(this.props.items)) {
return;
}
+ const isOpen = !this.state.isOpen;
this.setState({
- isOpen: !this.state.isOpen,
+ isOpen,
});
+
+ if (isOpen && this.props.onOpen) {
+ this.props.onOpen();
+ }
};
private readonly _closeDropdown = (): void => {
this.setState({