From 5c91b4bfc625b02a303ff50732eccb2fddf3f679 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 20:12:47 -0700 Subject: Re-designed Wiki and half-redesigned docs pages --- packages/website/less/all.less | 32 ++++--- packages/website/public/css/github-gist.css | 71 ++++++++++++++ packages/website/public/images/book.png | Bin 0 -> 963 bytes packages/website/public/index.html | 2 +- packages/website/ts/components/top_bar/top_bar.tsx | 91 +++++++++--------- packages/website/ts/components/ui/badge.tsx | 1 - .../ts/pages/documentation/documentation.tsx | 8 +- .../ts/pages/documentation/method_block.tsx | 19 ++-- packages/website/ts/pages/shared/anchor_title.tsx | 7 +- .../ts/pages/shared/markdown_code_block.tsx | 2 +- .../website/ts/pages/shared/markdown_section.tsx | 17 ++-- .../ts/pages/shared/nested_sidebar_menu.tsx | 42 ++++++++- packages/website/ts/pages/wiki/wiki.tsx | 105 +++++++++++++++------ packages/website/ts/utils/colors.ts | 3 + 14 files changed, 277 insertions(+), 123 deletions(-) create mode 100644 packages/website/public/css/github-gist.css create mode 100644 packages/website/public/images/book.png diff --git a/packages/website/less/all.less b/packages/website/less/all.less index 7f2a8fc67..113dff0be 100644 --- a/packages/website/less/all.less +++ b/packages/website/less/all.less @@ -61,7 +61,8 @@ a { */ ::-webkit-scrollbar { -webkit-appearance: none; - width: 7px; + width: 4px; + height: 2px; } ::-webkit-scrollbar-thumb { border-radius: 4px; @@ -85,19 +86,28 @@ a { } code { - font-family: 'Roboto'; - background-color: #f3f4f4; - color: rgb(36, 41, 46); - padding: 3px; - - &.hljs { - background-color: #dde4e9 !important; // blue gray - border-left: 5px solid #0091ea !important; // colors.lightBlueA700 - padding: 30px; - } + border: 1px solid #e3eefe; + font-family: 'Roboto Mono'; + background-color: #f2f6ff !important; // lightBlue } #wiki { + p { + color: #515151; // grey750 + fontsize: 15; + } + + a { + color: #1d5cde; // linkBlue + } + + h1, + h2, + h3, + h4 { + padding-top: 15px; + } + p, blockquote, ol, diff --git a/packages/website/public/css/github-gist.css b/packages/website/public/css/github-gist.css new file mode 100644 index 000000000..d5c8751c5 --- /dev/null +++ b/packages/website/public/css/github-gist.css @@ -0,0 +1,71 @@ +/** + * GitHub Gist Theme + * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro + */ + +.hljs { + display: block; + background: white; + padding: 0.5em; + color: #333333; + overflow-x: auto; +} + +.hljs-comment, +.hljs-meta { + color: #969896; +} + +.hljs-string, +.hljs-variable, +.hljs-template-variable, +.hljs-strong, +.hljs-emphasis, +.hljs-quote { + color: #df5000; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-type { + color: #a71d5d; +} + +.hljs-literal, +.hljs-symbol, +.hljs-bullet, +.hljs-attribute { + color: #0086b3; +} + +.hljs-section, +.hljs-name { + color: #63a35c; +} + +.hljs-tag { + color: #333333; +} + +.hljs-title, +.hljs-attr, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #795da3; +} + +.hljs-addition { + color: #55a532; + background-color: #eaffea; +} + +.hljs-deletion { + color: #bd2c00; + background-color: #ffecec; +} + +.hljs-link { + text-decoration: underline; +} diff --git a/packages/website/public/images/book.png b/packages/website/public/images/book.png new file mode 100644 index 000000000..0b0598f66 Binary files /dev/null and b/packages/website/public/images/book.png differ diff --git a/packages/website/public/index.html b/packages/website/public/index.html index d7006c518..3072ff03d 100644 --- a/packages/website/public/index.html +++ b/packages/website/public/index.html @@ -12,7 +12,7 @@ 0x: The Protocol for Trading Tokens - + diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index b1367be4f..589375da3 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -228,52 +228,54 @@ export class TopBar extends React.Component { openSecondary={true} onRequestChange={this._onMenuButtonClick.bind(this)} > - {this._renderPortalMenu()} - {this._renderDocsMenu()} - {this._renderWiki()} -
- Website -
- - Home - - - Wiki - - {!this._isViewing0xjsDocs() && ( - - 0x.js Docs +
+ {this._renderPortalMenu()} + {this._renderDocsMenu()} + {this._renderWiki()} +
+ Website +
+ + Home - )} - {!this._isViewingConnectDocs() && ( - - 0x Connect Docs + + Wiki - )} - {!this._isViewingSmartContractsDocs() && ( - - Smart Contract Docs + {!this._isViewing0xjsDocs() && ( + + 0x.js Docs + + )} + {!this._isViewingConnectDocs() && ( + + 0x Connect Docs + + )} + {!this._isViewingSmartContractsDocs() && ( + + Smart Contract Docs + + )} + {!this._isViewingPortal() && ( + + Portal DApp + + )} + + Whitepaper + + + About - )} - {!this._isViewingPortal() && ( - - Portal DApp + + Blog + + + + FAQ + - )} - - Whitepaper - - - About - - - Blog - - - - FAQ - - +
); } @@ -294,6 +296,7 @@ export class TopBar extends React.Component { { return (
-
- 0x Protocol Wiki -
diff --git a/packages/website/ts/components/ui/badge.tsx b/packages/website/ts/components/ui/badge.tsx index 7f7ea006e..056d741e0 100644 --- a/packages/website/ts/components/ui/badge.tsx +++ b/packages/website/ts/components/ui/badge.tsx @@ -8,7 +8,6 @@ const styles: Styles = { fontSize: 11, height: 10, borderRadius: 5, - marginTop: 25, lineHeight: 0.9, fontFamily: 'Roboto Mono', marginLeft: 3, diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 7ad1d3b9c..e20040bc0 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -138,6 +138,7 @@ export class Documentation extends React.Component
-

- - {this.props.docsInfo.displayName} - -

{this._renderDocumentation()}
@@ -220,7 +216,7 @@ export class Documentation extends React.Component -
+
diff --git a/packages/website/ts/pages/documentation/method_block.tsx b/packages/website/ts/pages/documentation/method_block.tsx index dfde5931b..78ba2ba1e 100644 --- a/packages/website/ts/pages/documentation/method_block.tsx +++ b/packages/website/ts/pages/documentation/method_block.tsx @@ -28,8 +28,7 @@ const styles: Styles = { color: colors.white, height: 11, borderRadius: 14, - marginTop: 19, - lineHeight: 0.8, + lineHeight: 0.9, }, }; @@ -55,16 +54,18 @@ export class MethodBlock extends React.Component {!method.isConstructor && ( -
+
{(method as TypescriptMethod).isStatic && this._renderChip('Static')} {(method as SolidityMethod).isConstant && this._renderChip('Constant')} {(method as SolidityMethod).isPayable && this._renderChip('Payable')} - +
+ +
)} diff --git a/packages/website/ts/pages/shared/anchor_title.tsx b/packages/website/ts/pages/shared/anchor_title.tsx index db5be1f59..0270618a0 100644 --- a/packages/website/ts/pages/shared/anchor_title.tsx +++ b/packages/website/ts/pages/shared/anchor_title.tsx @@ -34,18 +34,13 @@ const styles: Styles = { }, h1: { fontSize: '1.8em', - WebkitMarginBefore: '0.83em', - WebkitMarginAfter: '0.83em', }, h2: { fontSize: '1.5em', - WebkitMarginBefore: '0.83em', - WebkitMarginAfter: '0.83em', + fontWeight: 400, }, h3: { fontSize: '1.17em', - WebkitMarginBefore: '1em', - WebkitMarginAfter: '1em', }, }; diff --git a/packages/website/ts/pages/shared/markdown_code_block.tsx b/packages/website/ts/pages/shared/markdown_code_block.tsx index be96fda16..98ca3aee6 100644 --- a/packages/website/ts/pages/shared/markdown_code_block.tsx +++ b/packages/website/ts/pages/shared/markdown_code_block.tsx @@ -17,7 +17,7 @@ export class MarkdownCodeBlock extends React.Component + {this.props.literal} ); diff --git a/packages/website/ts/pages/shared/markdown_section.tsx b/packages/website/ts/pages/shared/markdown_section.tsx index 5487dc8cc..0ce348c98 100644 --- a/packages/website/ts/pages/shared/markdown_section.tsx +++ b/packages/website/ts/pages/shared/markdown_section.tsx @@ -6,6 +6,7 @@ import { Element as ScrollElement } from 'react-scroll'; import { AnchorTitle } from 'ts/pages/shared/anchor_title'; import { MarkdownCodeBlock } from 'ts/pages/shared/markdown_code_block'; import { HeaderSizes } from 'ts/types'; +import { colors } from 'ts/utils/colors'; import { utils } from 'ts/utils/utils'; interface MarkdownSectionProps { @@ -34,14 +35,14 @@ export class MarkdownSection extends React.Component
- +
-
+
{!_.isUndefined(this.props.githubLink) && ( - } - /> + style={{ color: colors.linkBlue, textDecoration: 'none', lineHeight: 2.1 }} + > + Edit on Github + )}
+
diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx index 849c33504..fde6ef7ae 100644 --- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx +++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx @@ -11,12 +11,12 @@ import { utils } from 'ts/utils/utils'; interface NestedSidebarMenuProps { topLevelMenu: { [topLevel: string]: string[] }; menuSubsectionsBySection: MenuSubsectionsBySection; + title: string; shouldDisplaySectionHeaders?: boolean; onMenuItemClick?: () => void; selectedVersion?: string; versions?: string[]; docPath?: string; - isSectionHeaderClickable?: boolean; } interface NestedSidebarMenuState {} @@ -29,7 +29,10 @@ const styles: Styles = { minHeight: 48, }, menuItemInnerDivWithHeaders: { + color: colors.grey800, + fontSize: 14, lineHeight: 2, + padding: 0, }, }; @@ -44,14 +47,14 @@ export class NestedSidebarMenu extends React.Component +
-
+
{finalSectionName.toUpperCase()}
@@ -64,6 +67,7 @@ export class NestedSidebarMenu extends React.Component + {this._renderEmblem()} {!_.isUndefined(this.props.versions) && !_.isUndefined(this.props.selectedVersion) && !_.isUndefined(this.props.docPath) && ( @@ -73,7 +77,35 @@ export class NestedSidebarMenu extends React.Component )} - {navigation} +
{navigation}
+
+ ); + } + private _renderEmblem() { + return ( +
+
+
+ 0x +
+
+ docs +
+
+
+ | +
+
+
+ +
+
+ {this.props.title} +
+
); } @@ -132,7 +164,7 @@ export class NestedSidebarMenu extends React.Component { this._isUnmounted = false; this.state = { articlesBySection: undefined, + isHoveringSidebar: false, }; } public componentWillMount() { @@ -65,6 +68,10 @@ export class Wiki extends React.Component { const menuSubsectionsBySection = _.isUndefined(this.state.articlesBySection) ? {} : this._getMenuSubsectionsBySection(this.state.articlesBySection); + const mainContainersStyle: React.CSSProperties = { + ...styles.mainContainers, + overflow: this.state.isHoveringSidebar ? 'auto' : 'hidden', + }; return (
@@ -72,10 +79,10 @@ export class Wiki extends React.Component { blockchainIsLoaded={false} location={this.props.location} menuSubsectionsBySection={menuSubsectionsBySection} - shouldFullWidth={true} + shouldFullWidth={false} /> {_.isUndefined(this.state.articlesBySection) ? ( -
+
{
) : ( -
-
+
+
- +
+ +
-
-
-
-
-

- - 0x Protocol Wiki - -

-
{this._renderWikiArticles()}
+
+
+
+
+ {this._renderWikiArticles()} +
+
@@ -135,18 +164,22 @@ export class Wiki extends React.Component { headerSize={HeaderSizes.H2} githubLink={githubLink} /> -
- See a way to make this article better?{' '} - - Edit here → - +
+
+ See a way to improve this article? +
+
+ +
); }); return ( -
- +
+ {/*
+ +
*/} {renderedArticles}
); @@ -203,4 +236,14 @@ export class Wiki extends React.Component { } return menuSubsectionsBySection; } + private _onSidebarHover(event: React.FormEvent) { + this.setState({ + isHoveringSidebar: true, + }); + } + private _onSidebarHoverOff() { + this.setState({ + isHoveringSidebar: false, + }); + } } diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts index 58ce667e3..b6b5a31e7 100644 --- a/packages/website/ts/utils/colors.ts +++ b/packages/website/ts/utils/colors.ts @@ -2,6 +2,7 @@ import { colors as materialUiColors } from 'material-ui/styles'; export const colors = { ...materialUiColors, + gray40: '#F8F8F8', grey50: '#FAFAFA', grey100: '#F5F5F5', lightestGrey: '#F0F0F0', @@ -15,6 +16,7 @@ export const colors = { darkGrey: '#818181', landingLinkGrey: '#919191', grey700: '#616161', + grey750: '#515151', grey800: '#424242', darkerGrey: '#393939', heroGrey: '#404040', @@ -23,6 +25,7 @@ export const colors = { dharmaDarkGrey: '#252525', lightBlue: '#60A4F4', lightBlueA700: '#0091EA', + linkBlue: '#1D5CDE', darkBlue: '#4D5481', turquois: '#058789', lightPurple: '#A81CA6', -- cgit v1.2.3 From 6cd4e7a17edbb474de6a82f0e665a1238b3724ba Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 21:51:37 -0700 Subject: Add icons for all doc pages --- packages/website/public/images/book.png | Bin 963 -> 0 bytes packages/website/public/images/doc_icons/connect.png | Bin 0 -> 361 bytes packages/website/public/images/doc_icons/contracts.png | Bin 0 -> 1104 bytes packages/website/public/images/doc_icons/wiki.png | Bin 0 -> 760 bytes packages/website/public/images/doc_icons/zeroExJs.png | Bin 0 -> 1318 bytes 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 packages/website/public/images/book.png create mode 100644 packages/website/public/images/doc_icons/connect.png create mode 100644 packages/website/public/images/doc_icons/contracts.png create mode 100644 packages/website/public/images/doc_icons/wiki.png create mode 100644 packages/website/public/images/doc_icons/zeroExJs.png diff --git a/packages/website/public/images/book.png b/packages/website/public/images/book.png deleted file mode 100644 index 0b0598f66..000000000 Binary files a/packages/website/public/images/book.png and /dev/null differ diff --git a/packages/website/public/images/doc_icons/connect.png b/packages/website/public/images/doc_icons/connect.png new file mode 100644 index 000000000..ba9bb8a3a Binary files /dev/null and b/packages/website/public/images/doc_icons/connect.png differ diff --git a/packages/website/public/images/doc_icons/contracts.png b/packages/website/public/images/doc_icons/contracts.png new file mode 100644 index 000000000..f5c6545ca Binary files /dev/null and b/packages/website/public/images/doc_icons/contracts.png differ diff --git a/packages/website/public/images/doc_icons/wiki.png b/packages/website/public/images/doc_icons/wiki.png new file mode 100644 index 000000000..d7854d54b Binary files /dev/null and b/packages/website/public/images/doc_icons/wiki.png differ diff --git a/packages/website/public/images/doc_icons/zeroExJs.png b/packages/website/public/images/doc_icons/zeroExJs.png new file mode 100644 index 000000000..029777ffe Binary files /dev/null and b/packages/website/public/images/doc_icons/zeroExJs.png differ -- cgit v1.2.3 From 2778f96483ea21f5ec33f4222c19d7864eca2f1f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 21:51:49 -0700 Subject: Re-design docs pages --- packages/website/ts/components/top_bar/top_bar.tsx | 3 -- .../ts/containers/connect_documentation.tsx | 5 +- .../ts/containers/zero_ex_js_documentation.tsx | 3 +- .../ts/pages/documentation/documentation.tsx | 54 ++++++++++++++-------- .../ts/pages/documentation/method_block.tsx | 9 +++- .../ts/pages/documentation/method_signature.tsx | 47 ++++++++++++++----- .../ts/pages/shared/nested_sidebar_menu.tsx | 9 +++- 7 files changed, 91 insertions(+), 39 deletions(-) diff --git a/packages/website/ts/components/top_bar/top_bar.tsx b/packages/website/ts/components/top_bar/top_bar.tsx index 589375da3..a412007f2 100644 --- a/packages/website/ts/components/top_bar/top_bar.tsx +++ b/packages/website/ts/components/top_bar/top_bar.tsx @@ -290,9 +290,6 @@ export class TopBar extends React.Component { const sectionTitle = `${this.props.docsInfo.displayName} Docs`; return (
-
- {sectionTitle} -
{_.isUndefined(this.state.docAgnosticFormat) ? ( @@ -129,26 +130,41 @@ export class Documentation extends React.Component
) : ( -
-
+
+
- +
+ +
-
-
-
-
- {this._renderDocumentation()} +
+
+
+ {this._renderDocumentation()} +
diff --git a/packages/website/ts/pages/documentation/method_block.tsx b/packages/website/ts/pages/documentation/method_block.tsx index 78ba2ba1e..1bc6aa4f4 100644 --- a/packages/website/ts/pages/documentation/method_block.tsx +++ b/packages/website/ts/pages/documentation/method_block.tsx @@ -122,12 +122,17 @@ export class MethodBlock extends React.Component
-
{parameter.name}
+
+ {parameter.name} +
{isOptional && 'optional'}
-
+
{parameter.comment && }
diff --git a/packages/website/ts/pages/documentation/method_signature.tsx b/packages/website/ts/pages/documentation/method_signature.tsx index 041dcd093..a24d35924 100644 --- a/packages/website/ts/pages/documentation/method_signature.tsx +++ b/packages/website/ts/pages/documentation/method_signature.tsx @@ -1,5 +1,6 @@ import * as _ from 'lodash'; import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import { DocsInfo } from 'ts/pages/documentation/docs_info'; import { Type } from 'ts/pages/documentation/type'; import { Parameter, SolidityMethod, TypeDefinitionByName, TypescriptMethod } from 'ts/types'; @@ -22,26 +23,50 @@ const defaultProps = { export const MethodSignature: React.SFC = (props: MethodSignatureProps) => { const sectionName = constants.TYPES_SECTION_NAME; const parameters = renderParameters(props.method, props.docsInfo, sectionName, props.typeDefinitionByName); - const paramString = _.reduce(parameters, (prev: React.ReactNode, curr: React.ReactNode) => { - return [prev, ', ', curr]; + const paramStringArray: any[] = []; + _.each(parameters, (param: React.ReactNode, i: number) => { + const finalParam = + parameters.length > 2 ? ( + + {param} + + ) : ( + param + ); + paramStringArray.push(finalParam); + const comma = + parameters.length > 2 ? ( + + ,
+
+ ) : ( + ', ' + ); + paramStringArray.push(comma); }); + if (parameters.length <= 2) { + paramStringArray.pop(); + } const methodName = props.shouldHideMethodName ? '' : props.method.name; const typeParameterIfExists = _.isUndefined((props.method as TypescriptMethod).typeParameter) ? undefined : renderTypeParameter(props.method, props.docsInfo, sectionName, props.typeDefinitionByName); return ( - + {props.method.callPath} {methodName} - {typeParameterIfExists}({paramString}) - {props.shouldUseArrowSyntax ? ' => ' : ': '}{' '} + {typeParameterIfExists}({parameters.length > 2 &&
} + {paramStringArray}) {props.method.returnType && ( - + + {props.shouldUseArrowSyntax ? ' => ' : ': '}{' '} + + )}
); diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx index fde6ef7ae..1b63f5203 100644 --- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx +++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx @@ -36,6 +36,13 @@ const styles: Styles = { }, }; +const titleToIcon: { [title: string]: string } = { + '0x.js': 'zeroExJs.png', + '0x Connect': 'connect.png', + '0x Smart Contracts': 'contracts.png', + Wiki: 'wiki.png', +}; + export class NestedSidebarMenu extends React.Component { public static defaultProps: Partial = { shouldDisplaySectionHeaders: true, @@ -100,7 +107,7 @@ export class NestedSidebarMenu extends React.Component
- +
{this.props.title} -- cgit v1.2.3 From 03797545f92733b3539001fa8518a523a44310ac Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 23:51:10 -0700 Subject: uncomment dev logic --- packages/website/ts/containers/connect_documentation.tsx | 5 ++--- packages/website/ts/containers/zero_ex_js_documentation.tsx | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/website/ts/containers/connect_documentation.tsx b/packages/website/ts/containers/connect_documentation.tsx index 2c1de2970..fd3029970 100644 --- a/packages/website/ts/containers/connect_documentation.tsx +++ b/packages/website/ts/containers/connect_documentation.tsx @@ -24,9 +24,8 @@ const connectDocSections = { types: constants.TYPES_SECTION_NAME, }; -// const s3BucketName = -// configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-connect-docs-jsons' : 'connect-docs-jsons'; -const s3BucketName = 'connect-docs-jsons'; +const s3BucketName = + configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-connect-docs-jsons' : 'connect-docs-jsons'; const docsJsonRoot = `https://s3.amazonaws.com/${s3BucketName}`; const docsInfoConfig: DocsInfoConfig = { diff --git a/packages/website/ts/containers/zero_ex_js_documentation.tsx b/packages/website/ts/containers/zero_ex_js_documentation.tsx index fd9eb5846..eee2c7cc8 100644 --- a/packages/website/ts/containers/zero_ex_js_documentation.tsx +++ b/packages/website/ts/containers/zero_ex_js_documentation.tsx @@ -36,8 +36,7 @@ const zeroExJsDocSections = { types: constants.TYPES_SECTION_NAME, }; -// const s3BucketName = configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-0xjs-docs-jsons' : '0xjs-docs-jsons'; -const s3BucketName = '0xjs-docs-jsons'; +const s3BucketName = configs.ENVIRONMENT === Environments.DEVELOPMENT ? 'staging-0xjs-docs-jsons' : '0xjs-docs-jsons'; const docsJsonRoot = `https://s3.amazonaws.com/${s3BucketName}`; const docsInfoConfig: DocsInfoConfig = { -- cgit v1.2.3 From c6ecdbd86e3066b76e62f4f6eae5990414e9c84a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 23:52:40 -0700 Subject: use const over hard-coding --- packages/website/ts/pages/documentation/documentation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 2227f59d3..9591ddabe 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -68,7 +68,7 @@ const styles: Styles = { right: 0, overflowZ: 'hidden', overflowY: 'scroll', - minHeight: 'calc(100vh - 60px)', + minHeight: `calc(100vh - ${TOP_BAR_HEIGHT}px)`, WebkitOverflowScrolling: 'touch', }, menuContainer: { -- cgit v1.2.3 From 8a52ffe7b7d4e2079b119f2c2b5cb885b17f1cd5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 23:52:49 -0700 Subject: Remove unneeded props --- packages/website/ts/pages/documentation/documentation.tsx | 1 - packages/website/ts/pages/wiki/wiki.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 9591ddabe..691a5e9be 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -112,7 +112,6 @@ export class Documentation extends React.Component {_.isUndefined(this.state.docAgnosticFormat) ? ( diff --git a/packages/website/ts/pages/wiki/wiki.tsx b/packages/website/ts/pages/wiki/wiki.tsx index 944f429be..bbbda6eee 100644 --- a/packages/website/ts/pages/wiki/wiki.tsx +++ b/packages/website/ts/pages/wiki/wiki.tsx @@ -79,7 +79,6 @@ export class Wiki extends React.Component { blockchainIsLoaded={false} location={this.props.location} menuSubsectionsBySection={menuSubsectionsBySection} - shouldFullWidth={false} /> {_.isUndefined(this.state.articlesBySection) ? (
-- cgit v1.2.3 From 974fab72844d51314f726316d25161e1a8c14cc1 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 23:54:36 -0700 Subject: replace repeated conditionals with variable --- .../ts/pages/documentation/method_signature.tsx | 35 +++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/website/ts/pages/documentation/method_signature.tsx b/packages/website/ts/pages/documentation/method_signature.tsx index a24d35924..f94524b48 100644 --- a/packages/website/ts/pages/documentation/method_signature.tsx +++ b/packages/website/ts/pages/documentation/method_signature.tsx @@ -24,27 +24,26 @@ export const MethodSignature: React.SFC = (props: MethodSi const sectionName = constants.TYPES_SECTION_NAME; const parameters = renderParameters(props.method, props.docsInfo, sectionName, props.typeDefinitionByName); const paramStringArray: any[] = []; + const hasMoreThenTwoParams = parameters.length > 2; _.each(parameters, (param: React.ReactNode, i: number) => { - const finalParam = - parameters.length > 2 ? ( - - {param} - - ) : ( - param - ); + const finalParam = hasMoreThenTwoParams ? ( + + {param} + + ) : ( + param + ); paramStringArray.push(finalParam); - const comma = - parameters.length > 2 ? ( - - ,
-
- ) : ( - ', ' - ); + const comma = hasMoreThenTwoParams ? ( + + ,
+
+ ) : ( + ', ' + ); paramStringArray.push(comma); }); - if (parameters.length <= 2) { + if (!hasMoreThenTwoParams) { paramStringArray.pop(); } const methodName = props.shouldHideMethodName ? '' : props.method.name; @@ -55,7 +54,7 @@ export const MethodSignature: React.SFC = (props: MethodSi {props.method.callPath} {methodName} - {typeParameterIfExists}({parameters.length > 2 &&
} + {typeParameterIfExists}({hasMoreThenTwoParams &&
} {paramStringArray}) {props.method.returnType && ( -- cgit v1.2.3 From 9349752baa3d17b8c8d25eec0c4594f1f547fceb Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 15 Feb 2018 23:56:19 -0700 Subject: Add hack comment explaining param count short-cut --- packages/website/ts/pages/documentation/method_signature.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/website/ts/pages/documentation/method_signature.tsx b/packages/website/ts/pages/documentation/method_signature.tsx index f94524b48..22294e428 100644 --- a/packages/website/ts/pages/documentation/method_signature.tsx +++ b/packages/website/ts/pages/documentation/method_signature.tsx @@ -24,6 +24,9 @@ export const MethodSignature: React.SFC = (props: MethodSi const sectionName = constants.TYPES_SECTION_NAME; const parameters = renderParameters(props.method, props.docsInfo, sectionName, props.typeDefinitionByName); const paramStringArray: any[] = []; + // HACK: For now we don't put params on newlines if there are less then 2 of them. + // Ideally we would check the character length of the resulting method signature and + // if it exceeds the available space, put params on their own lines. const hasMoreThenTwoParams = parameters.length > 2; _.each(parameters, (param: React.ReactNode, i: number) => { const finalParam = hasMoreThenTwoParams ? ( -- cgit v1.2.3 From 05c3a66543a04af25e668e9e4041eaa9291d9102 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 16 Feb 2018 00:08:57 -0700 Subject: Add more padding on top of section title --- packages/website/ts/pages/shared/markdown_section.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/ts/pages/shared/markdown_section.tsx b/packages/website/ts/pages/shared/markdown_section.tsx index 0ce348c98..4d7d8b4ca 100644 --- a/packages/website/ts/pages/shared/markdown_section.tsx +++ b/packages/website/ts/pages/shared/markdown_section.tsx @@ -35,12 +35,12 @@ export class MarkdownSection extends React.Component -
+
Date: Fri, 16 Feb 2018 00:09:10 -0700 Subject: Remove section links until they go somewhere --- packages/website/ts/pages/shared/nested_sidebar_menu.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx index 1b63f5203..9285f0215 100644 --- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx +++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx @@ -55,16 +55,9 @@ export class NestedSidebarMenu extends React.Component - -
- {finalSectionName.toUpperCase()} -
-
+
+ {finalSectionName.toUpperCase()} +
{this._renderMenuItems(menuItems)}
); -- cgit v1.2.3 From 0114fc960862d92a08ce57ebc06e6bdf1714ac08 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Fri, 16 Feb 2018 00:12:27 -0700 Subject: remove hard-coded color --- packages/website/ts/pages/shared/nested_sidebar_menu.tsx | 5 +---- packages/website/ts/utils/colors.ts | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx index 9285f0215..ba794ee9f 100644 --- a/packages/website/ts/pages/shared/nested_sidebar_menu.tsx +++ b/packages/website/ts/pages/shared/nested_sidebar_menu.tsx @@ -92,10 +92,7 @@ export class NestedSidebarMenu extends React.Component
-
+
|
diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts index b6b5a31e7..b55543151 100644 --- a/packages/website/ts/utils/colors.ts +++ b/packages/website/ts/utils/colors.ts @@ -9,6 +9,7 @@ export const colors = { greyishPink: '#E6E5E5', grey300: '#E0E0E0', beigeWhite: '#E4E4E4', + grey350: '#cacaca', grey400: '#BDBDBD', lightGrey: '#BBBBBB', grey500: '#9E9E9E', -- cgit v1.2.3