aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-05-18 08:38:01 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-05-19 02:35:13 +0800
commite6e8d49d724fffff9874a525fbdc258d21715f56 (patch)
treee5ff1ad3fa81604bea953b70d9a8cbc89bc285c0 /packages/website/ts/components
parentb9ca055586ee1bdc89684b173186c92bd2f97e9f (diff)
downloaddexon-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
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/top_bar/top_bar.tsx7
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;