diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-28 01:50:56 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-28 01:50:56 +0800 |
commit | be787a0fd19a658cbf21eb90140c76779647dfbc (patch) | |
tree | e3d396c6a29ebca194b29b75886c9b9b9db43e4f /packages/instant/src/components/ui | |
parent | fdc4a4e5fa31d8797abf6313f4488147853ed77e (diff) | |
download | dexon-sol-tools-be787a0fd19a658cbf21eb90140c76779647dfbc.tar.gz 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.tsx | 8 |
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({ |