diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-05-18 08:38:01 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-05-19 02:35:13 +0800 |
commit | e6e8d49d724fffff9874a525fbdc258d21715f56 (patch) | |
tree | e5ff1ad3fa81604bea953b70d9a8cbc89bc285c0 | |
parent | b9ca055586ee1bdc89684b173186c92bd2f97e9f (diff) | |
download | dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.tar dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.tar.gz dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.tar.bz2 dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.tar.lz dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.tar.xz dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.tar.zst dexon-sol-tools-e6e8d49d724fffff9874a525fbdc258d21715f56.zip |
Close drawer when new path is chosen
-rw-r--r-- | packages/website/ts/components/top_bar/top_bar.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index 076f90b22..2c3273dee 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -95,6 +95,13 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> { isDrawerOpen: false, }; } + public componentWillReceiveProps(nextProps: TopBarProps): void { + if (nextProps.location.pathname !== this.props.location.pathname) { + this.setState({ + isDrawerOpen: false, + }); + } + } public render(): React.ReactNode { const isNightVersion = this.props.isNightVersion; const isExpandedDisplayType = this.props.displayType === TopBarDisplayType.Expanded; |