diff --git a/packages/website/less/all.less b/packages/website/less/all.less index 7f2a8fc674..113dff0be8 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 0000000000..d5c8751c54 --- /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/doc_icons/connect.png b/packages/website/public/images/doc_icons/connect.png new file mode 100644 index 0000000000..ba9bb8a3a7 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 0000000000..f5c6545ca7 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 0000000000..d7854d54b9 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 0000000000..029777ffeb Binary files /dev/null and b/packages/website/public/images/doc_icons/zeroExJs.png differ diff --git a/packages/website/public/index.html b/packages/website/public/index.html index d7006c518f..3072ff03d9 100644 --- a/packages/website/public/index.html +++ b/packages/website/public/index.html @@ -12,7 +12,7 @@
@@ -121,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 041dcd0937..22294e4288 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,52 @@ 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[] = [];
+ // 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 ? (
+
+ {param}
+
+ ) : (
+ param
+ );
+ paramStringArray.push(finalParam);
+ const comma = hasMoreThenTwoParams ? (
+
+ ,
+
+ ) : (
+ ', '
+ );
+ paramStringArray.push(comma);
});
+ if (!hasMoreThenTwoParams) {
+ 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}({hasMoreThenTwoParams &&
}
+ {paramStringArray})
{props.method.returnType && (
-
+
+ {props.shouldUseArrowSyntax ? ' => ' : ': '}{' '}
+
+
)}
);
diff --git a/packages/website/ts/pages/shared/anchor_title.tsx b/packages/website/ts/pages/shared/anchor_title.tsx
index db5be1f599..0270618a0c 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 be96fda163..98ca3aee6f 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 5487dc8cc9..4d7d8b4ca0 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 849c335044..ba794ee9f7 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,10 +29,20 @@ const styles: Styles = {
minHeight: 48,
},
menuItemInnerDivWithHeaders: {
+ color: colors.grey800,
+ fontSize: 14,
lineHeight: 2,
+ padding: 0,
},
};
+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,
@@ -44,17 +54,10 @@ export class NestedSidebarMenu extends React.Component
-
-
- {finalSectionName.toUpperCase()}
-
-
+
+
+ {finalSectionName.toUpperCase()}
+
{this._renderMenuItems(menuItems)}
);
@@ -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,32 @@ export class NestedSidebarMenu extends React.Component
)}
- {navigation}
+ {navigation}
+
+ );
+ }
+ private _renderEmblem() {
+ return (
+
+
+
+ 0x
+
+
+ docs
+
+
+
+ |
+
+
+
+
+
+
+ {this.props.title}
+
+
);
}
@@ -132,7 +161,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,9 @@ export class Wiki extends React.Component {
blockchainIsLoaded={false}
location={this.props.location}
menuSubsectionsBySection={menuSubsectionsBySection}
- shouldFullWidth={true}
/>
{_.isUndefined(this.state.articlesBySection) ? (
-
+
{
) : (
-
-
+
+
-
+
+
+
-
-
-
-
-
-
- 0x Protocol Wiki
-
-
- {this._renderWikiArticles()}
+
+
+
+
+ {this._renderWikiArticles()}
+
+
@@ -135,18 +163,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 +235,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 58ce667e30..b55543151f 100644
--- a/packages/website/ts/utils/colors.ts
+++ b/packages/website/ts/utils/colors.ts
@@ -2,12 +2,14 @@ import { colors as materialUiColors } from 'material-ui/styles';
export const colors = {
...materialUiColors,
+ gray40: '#F8F8F8',
grey50: '#FAFAFA',
grey100: '#F5F5F5',
lightestGrey: '#F0F0F0',
greyishPink: '#E6E5E5',
grey300: '#E0E0E0',
beigeWhite: '#E4E4E4',
+ grey350: '#cacaca',
grey400: '#BDBDBD',
lightGrey: '#BBBBBB',
grey500: '#9E9E9E',
@@ -15,6 +17,7 @@ export const colors = {
darkGrey: '#818181',
landingLinkGrey: '#919191',
grey700: '#616161',
+ grey750: '#515151',
grey800: '#424242',
darkerGrey: '#393939',
heroGrey: '#404040',
@@ -23,6 +26,7 @@ export const colors = {
dharmaDarkGrey: '#252525',
lightBlue: '#60A4F4',
lightBlueA700: '#0091EA',
+ linkBlue: '#1D5CDE',
darkBlue: '#4D5481',
turquois: '#058789',
lightPurple: '#A81CA6',