From 1d30a2f91dfc23242602ed0da011e6b4edd44f86 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sat, 13 Oct 2018 16:29:24 +0100 Subject: Remove doc menus from main topBar --- packages/website/ts/components/top_bar/top_bar.tsx | 69 ++-------------------- 1 file changed, 4 insertions(+), 65 deletions(-) (limited to 'packages/website') diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index 55a2a3954..f7043dca2 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -72,20 +72,6 @@ const styles: Styles = { }, }; -const DOC_WEBSITE_PATHS_TO_KEY = { - [WebsitePaths.SolCov]: Key.SolCov, - [WebsitePaths.SmartContracts]: Key.SmartContracts, - [WebsitePaths.Web3Wrapper]: Key.Web3Wrapper, - [WebsitePaths.SolCompiler]: Key.SolCompiler, - [WebsitePaths.JSONSchemas]: Key.JsonSchemas, - [WebsitePaths.Subproviders]: Key.Subproviders, - [WebsitePaths.ContractWrappers]: Key.ContractWrappers, - [WebsitePaths.Connect]: Key.Connect, - [WebsitePaths.ZeroExJs]: Key.ZeroExJs, - [WebsitePaths.OrderUtils]: Key.OrderUtils, - [WebsitePaths.OrderWatcher]: Key.OrderWatcher, -}; - const DEFAULT_HEIGHT = 68; const EXPANDED_HEIGHT = 75; @@ -245,7 +231,6 @@ export class TopBar extends React.Component { onRequestChange={this._onMenuButtonClick.bind(this)} >
- {this._renderDocsMenu()} {this._renderWiki()}
{this.props.translate.get(Key.Website, Deco.Cap)} @@ -253,22 +238,12 @@ export class TopBar extends React.Component { {this.props.translate.get(Key.Home, Deco.Cap)} + + {this.props.translate.get(Key.Documentation, Deco.Cap)} + {this.props.translate.get(Key.Wiki, Deco.Cap)} - {_.map(DOC_WEBSITE_PATHS_TO_KEY, (key, websitePath) => { - if (!this._doesUrlInclude(websitePath)) { - return ( - - - {this.props.translate.get(key, Deco.Cap)}{' '} - {this.props.translate.get(Key.Docs, Deco.Cap)} - - - ); - } - return null; - })} {!this._isViewingPortal() && ( @@ -297,30 +272,6 @@ export class TopBar extends React.Component { ); } - private _renderDocsMenu(): React.ReactNode { - const isViewingDocsPage = _.some(DOC_WEBSITE_PATHS_TO_KEY, (_key, websitePath) => { - return this._doesUrlInclude(websitePath); - }); - // HACK: We need to make sure the SCROLL_CONTAINER is loaded before rendering the Sidebar - // because the sidebar renders `react-scroll` links which depend on the scroll container already - // being rendered. - const documentationContainer = document.getElementById(sharedConstants.SCROLL_CONTAINER_ID); - if (!isViewingDocsPage || _.isUndefined(this.props.sectionNameToLinks) || _.isNull(documentationContainer)) { - return undefined; - } - return ( -
- -
- ); - } private _renderWiki(): React.ReactNode { if (!this._isViewingWiki()) { return undefined; @@ -344,9 +295,6 @@ export class TopBar extends React.Component { private _isViewingPortal(): boolean { return _.includes(this.props.location.pathname, WebsitePaths.Portal); } - private _isViewingDocs(): boolean { - return _.includes(this.props.location.pathname, WebsitePaths.Docs); - } private _isViewingFAQ(): boolean { return _.includes(this.props.location.pathname, WebsitePaths.FAQ); } @@ -357,15 +305,6 @@ export class TopBar extends React.Component { return _.includes(this.props.location.pathname, WebsitePaths.Wiki); } private _shouldDisplayBottomBar(): boolean { - const isViewingDocsPage = _.some(DOC_WEBSITE_PATHS_TO_KEY, (_key, websitePath) => { - return this._doesUrlInclude(websitePath); - }); - return ( - isViewingDocsPage || - this._isViewingWiki() || - this._isViewingFAQ() || - this._isViewingDocs() || - this._isViewingPortal() - ); + return this._isViewingWiki() || this._isViewingFAQ() || this._isViewingPortal(); } } // tslint:disable:max-file-line-count -- cgit v1.2.3