aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-29 06:02:31 +0800
committerFabio Berger <me@fabioberger.com>2017-11-29 06:02:31 +0800
commit3c3033586d517da667a7618f57c0bc131ae2599e (patch)
treed5eea64c6b1bfc3c53922b5f1abcb6c42e41e4cf /packages/website
parent166c741beb569ea5245a47203edaef4c9232b8d4 (diff)
downloaddexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.tar
dexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.tar.gz
dexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.tar.bz2
dexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.tar.lz
dexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.tar.xz
dexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.tar.zst
dexon-sol-tools-3c3033586d517da667a7618f57c0bc131ae2599e.zip
Add 0x Connect Docs to the menu and topBar
Diffstat (limited to 'packages/website')
-rw-r--r--packages/website/ts/components/top_bar.tsx26
-rw-r--r--packages/website/ts/pages/documentation/documentation.tsx2
2 files changed, 22 insertions, 6 deletions
diff --git a/packages/website/ts/components/top_bar.tsx b/packages/website/ts/components/top_bar.tsx
index 7b81253e2..79abd5356 100644
--- a/packages/website/ts/components/top_bar.tsx
+++ b/packages/website/ts/components/top_bar.tsx
@@ -34,7 +34,7 @@ interface TopBarProps {
menu?: DocsMenu;
menuSubsectionsBySection?: MenuSubsectionsBySection;
shouldFullWidth?: boolean;
- docPath?: string;
+ docsInfo?: DocsInfo;
style?: React.CSSProperties;
isNightVersion?: boolean;
}
@@ -111,6 +111,13 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
>
<MenuItem style={{fontSize: styles.menuItem.fontSize}} primaryText="Smart Contracts" />
</Link>,
+ <Link
+ key="subMenuItem-0xconnect"
+ to={WebsitePaths.Connect}
+ className="text-decoration-none"
+ >
+ <MenuItem style={{fontSize: styles.menuItem.fontSize}} primaryText="0x Connect" />
+ </Link>,
<a
key="subMenuItem-standard-relayer-api"
target="_blank"
@@ -235,6 +242,11 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
<MenuItem className="py2">0x.js Docs</MenuItem>
</Link>
}
+ {!this.isViewingConnectDocs() &&
+ <Link to={WebsitePaths.Connect} className="text-decoration-none">
+ <MenuItem className="py2">0x Connect Docs</MenuItem>
+ </Link>
+ }
{!this.isViewingSmartContractsDocs() &&
<Link to={WebsitePaths.SmartContracts} className="text-decoration-none">
<MenuItem className="py2">Smart Contract Docs</MenuItem>
@@ -274,11 +286,12 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
);
}
private renderDocsMenu() {
- if (!this.isViewing0xjsDocs() && !this.isViewingSmartContractsDocs() || _.isUndefined(this.props.menu)) {
+ if (!this.isViewing0xjsDocs() && !this.isViewingSmartContractsDocs() && !this.isViewingConnectDocs()
+ || _.isUndefined(this.props.menu)) {
return;
}
- const sectionTitle = this.isViewing0xjsDocs() ? '0x.js Docs' : 'Smart contract Docs';
+ const sectionTitle = `${this.props.docsInfo.packageName} Docs`;
return (
<div className="lg-hide md-hide">
<div className="pl1 py1" style={{backgroundColor: SECTION_HEADER_COLOR}}>{sectionTitle}</div>
@@ -288,7 +301,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
shouldDisplaySectionHeaders={false}
onMenuItemClick={this.onMenuButtonClick.bind(this)}
selectedVersion={this.props.docsVersion}
- docPath={this.props.docPath}
+ docPath={this.props.docsInfo.websitePath}
versions={this.props.availableDocVersions}
/>
</div>
@@ -362,6 +375,9 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
private isViewing0xjsDocs() {
return _.includes(this.props.location.pathname, WebsitePaths.ZeroExJs);
}
+ private isViewingConnectDocs() {
+ return _.includes(this.props.location.pathname, WebsitePaths.Connect);
+ }
private isViewingSmartContractsDocs() {
return _.includes(this.props.location.pathname, WebsitePaths.SmartContracts);
}
@@ -370,6 +386,6 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
}
private shouldDisplayBottomBar() {
return this.isViewingWiki() || this.isViewing0xjsDocs() || this.isViewingFAQ() ||
- this.isViewingSmartContractsDocs();
+ this.isViewingSmartContractsDocs() || this.isViewingConnectDocs();
}
}
diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx
index b56441bfe..27cd1da2c 100644
--- a/packages/website/ts/pages/documentation/documentation.tsx
+++ b/packages/website/ts/pages/documentation/documentation.tsx
@@ -120,7 +120,7 @@ export class Documentation extends
menu={this.props.docsInfo.getMenu(this.props.docsVersion)}
menuSubsectionsBySection={menuSubsectionsBySection}
shouldFullWidth={true}
- docPath={this.props.docsInfo.websitePath}
+ docsInfo={this.props.docsInfo}
/>
{_.isUndefined(this.state.docAgnosticFormat) ?
<div