diff --git a/src/handbook/index.html b/src/handbook/index.html index 4e84c88f2..a65597435 100644 --- a/src/handbook/index.html +++ b/src/handbook/index.html @@ -4,7 +4,12 @@ GM Handbook + + +
diff --git a/src/handbook/src/ui/widgets/HomeButton.tsx b/src/handbook/src/ui/widgets/HomeButton.tsx index 3c07ecda8..e95dda356 100644 --- a/src/handbook/src/ui/widgets/HomeButton.tsx +++ b/src/handbook/src/ui/widgets/HomeButton.tsx @@ -24,14 +24,22 @@ class HomeButton extends React.PureComponent { navigate(this.props.anchor); } + /** + * Checks if this component should be showed. + */ + private shouldShow(): boolean { + return !(((window as any).hide) as string[]) + .includes(this.props.anchor.toLowerCase()); + } + render() { - return ( + return this.shouldShow() ? (
this.redirect()}> {this.props.name}

{this.props.name}

- ); + ) : undefined; } } diff --git a/src/handbook/src/ui/widgets/SideBarButton.tsx b/src/handbook/src/ui/widgets/SideBarButton.tsx index 9af875558..83248560d 100644 --- a/src/handbook/src/ui/widgets/SideBarButton.tsx +++ b/src/handbook/src/ui/widgets/SideBarButton.tsx @@ -24,14 +24,22 @@ class SideBarButton extends React.PureComponent { navigate(this.props.anchor); } + /** + * Checks if this component should be showed. + */ + private shouldShow(): boolean { + return !(((window as any).hide) as string[]) + .includes(this.props.anchor.toLowerCase()); + } + render() { - return ( + return this.shouldShow() ? (
this.redirect()}> {this.props.name}

{this.props.name}

- ); + ) : undefined; } }