From f0afc0ae45c82d6e1227307e9cc7eca711ccaa05 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 11 Apr 2018 18:14:22 +0900 Subject: Update 0x.js and web3-wrapper doc urls so that last segment is identical to package name. Keep legacy endpoints. --- packages/website/ts/components/top_bar/top_bar.tsx | 12 +++++++++--- packages/website/ts/index.tsx | 13 ++++++++++++- packages/website/ts/types.ts | 9 +++++++-- 3 files changed, 28 insertions(+), 6 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 4b2e82119..13351dcdc 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -15,7 +15,7 @@ import { TopBarMenuItem } from 'ts/components/top_bar/top_bar_menu_item'; import { DropDown } from 'ts/components/ui/drop_down'; import { Identicon } from 'ts/components/ui/identicon'; import { Dispatcher } from 'ts/redux/dispatcher'; -import { Deco, Key, ProviderType, WebsitePaths } from 'ts/types'; +import { Deco, Key, ProviderType, WebsiteLegacyPaths, WebsitePaths } from 'ts/types'; import { constants } from 'ts/utils/constants'; import { Translate } from 'ts/utils/translate'; @@ -462,7 +462,10 @@ export class TopBar extends React.Component { return _.includes(this.props.location.pathname, WebsitePaths.FAQ); } private _isViewing0xjsDocs() { - return _.includes(this.props.location.pathname, WebsitePaths.ZeroExJs); + return ( + _.includes(this.props.location.pathname, WebsitePaths.ZeroExJs) || + _.includes(this.props.location.pathname, WebsiteLegacyPaths.ZeroExJs) + ); } private _isViewingConnectDocs() { return _.includes(this.props.location.pathname, WebsitePaths.Connect); @@ -471,7 +474,10 @@ export class TopBar extends React.Component { return _.includes(this.props.location.pathname, WebsitePaths.SmartContracts); } private _isViewingWeb3WrapperDocs() { - return _.includes(this.props.location.pathname, WebsitePaths.Web3Wrapper); + return ( + _.includes(this.props.location.pathname, WebsitePaths.Web3Wrapper) || + _.includes(this.props.location.pathname, WebsiteLegacyPaths.Web3Wrapper) + ); } private _isViewingDeployerDocs() { return _.includes(this.props.location.pathname, WebsitePaths.Deployer); diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx index d542bd804..5bc36da32 100644 --- a/packages/website/ts/index.tsx +++ b/packages/website/ts/index.tsx @@ -15,7 +15,7 @@ import { createLazyComponent } from 'ts/lazy_component'; import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage'; import { tradeHistoryStorage } from 'ts/local_storage/trade_history_storage'; import { reducer, State } from 'ts/redux/reducer'; -import { WebsitePaths } from 'ts/types'; +import { WebsiteLegacyPaths, WebsitePaths } from 'ts/types'; import { analytics } from 'ts/utils/analytics'; import { muiTheme } from 'ts/utils/mui_theme'; import { utils } from 'ts/utils/utils'; @@ -98,6 +98,17 @@ render( path={`${WebsitePaths.SmartContracts}/:version?`} component={LazySmartContractsDocumentation} /> + + {/* Legacy endpoints */} + + + diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index dba59f704..c03e5676f 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -341,17 +341,22 @@ export enum Docs { SmartContracts, } +export enum WebsiteLegacyPaths { + ZeroExJs = '/docs/0xjs', + Web3Wrapper = '/docs/web3_wrapper', +} + export enum WebsitePaths { Portal = '/portal', Wiki = '/wiki', - ZeroExJs = '/docs/0xjs', + ZeroExJs = '/docs/0x.js', Home = '/', FAQ = '/faq', About = '/about', Whitepaper = '/pdfs/0x_white_paper.pdf', SmartContracts = '/docs/contracts', Connect = '/docs/connect', - Web3Wrapper = '/docs/web3_wrapper', + Web3Wrapper = '/docs/web3-wrapper', Deployer = '/docs/deployer', JSONSchemas = '/docs/json-schemas', SolCov = '/docs/sol-cov', -- cgit