Merge branch 'development' into supportEIP1193Providers

* development:
  Demonstrate calling contracts with tuple arrays (#1615)
  removed default meta tags in public/index.html
  fixed linting issue
  updated documentTitle component
  added metadata for pages (incomplete)
  fixed title comment-out
  removed react-document-title in favor of using react-helmet for consistency and bug fix
This commit is contained in:
Fabio Berger 2019-02-21 16:45:00 -08:00
commit b51038b9e7
23 changed files with 204 additions and 45 deletions

View File

@ -57,7 +57,6 @@
"rc-slider": "^8.6.3", "rc-slider": "^8.6.3",
"react": "^16.5.2", "react": "^16.5.2",
"react-copy-to-clipboard": "^5.0.0", "react-copy-to-clipboard": "^5.0.0",
"react-document-title": "^2.0.3",
"react-dom": "^16.5.2", "react-dom": "^16.5.2",
"react-flickity-component": "^3.1.0", "react-flickity-component": "^3.1.0",
"react-headroom": "2.2.2", "react-headroom": "2.2.2",

View File

@ -3,16 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="An Open Protocol For Decentralized Exchange On The Ethereum Blockchain" />
<meta property="og:type" content="website" />
<meta property="og:title" content="0x" />
<meta
property="og:description"
content="An Open Protocol For Decentralized Exchange On The Ethereum Blockchain"
/>
<meta property="og:image" content="/images/og_image.png" />
<meta name="google-site-verification" content="0wu9KbpKgGXUhUboLQw-MGtAHJHQ67rMFQN8KrX5I1s" /> <meta name="google-site-verification" content="0wu9KbpKgGXUhUboLQw-MGtAHJHQ67rMFQN8KrX5I1s" />
<title>0x: The Protocol for Trading Tokens</title>
<link rel="icon" type="image/png" href="/images/favicon/favicon-2-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="/images/favicon/favicon-2-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/images/favicon/favicon-2-16x16.png" sizes="16x16" /> <link rel="icon" type="image/png" href="/images/favicon/favicon-2-16x16.png" sizes="16x16" />
<link rel="stylesheet" href="/css/material-design-iconic-font.min.css" /> <link rel="stylesheet" href="/css/material-design-iconic-font.min.css" />

View File

@ -0,0 +1,15 @@
import * as React from 'react';
import { Helmet } from 'react-helmet';
import { DocumentMetadata } from '../utils/document_meta_constants';
export interface DocumentTitleProps extends DocumentMetadata {}
export const DocumentTitle: React.StatelessComponent<DocumentTitleProps> = ({ title, description }) => (
<Helmet>
<title>{title}</title>
<meta name="description" content={description} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
</Helmet>
);

View File

@ -2,7 +2,6 @@ import { colors, Link } from '@0x/react-shared';
import { BigNumber } from '@0x/utils'; import { BigNumber } from '@0x/utils';
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import * as DocumentTitle from 'react-document-title';
import { Route, RouteComponentProps, Switch } from 'react-router-dom'; import { Route, RouteComponentProps, Switch } from 'react-router-dom';
import { Blockchain } from 'ts/blockchain'; import { Blockchain } from 'ts/blockchain';
@ -234,7 +233,6 @@ export class Portal extends React.Component<PortalProps, PortalState> {
return ( return (
<Container> <Container>
<MetaTags title={DOCUMENT_TITLE} description={DOCUMENT_DESCRIPTION} /> <MetaTags title={DOCUMENT_TITLE} description={DOCUMENT_DESCRIPTION} />
<DocumentTitle title={DOCUMENT_TITLE} />
<TopBar <TopBar
userAddress={this.props.userAddress} userAddress={this.props.userAddress}
networkId={this.props.networkId} networkId={this.props.networkId}

View File

@ -133,7 +133,6 @@ render(
<Route path={WebsitePaths.Portal} component={LazyPortal} /> <Route path={WebsitePaths.Portal} component={LazyPortal} />
<Route path={WebsitePaths.FAQ} component={FAQ as any} /> <Route path={WebsitePaths.FAQ} component={FAQ as any} />
<Route path={WebsitePaths.Wiki} component={Wiki as any} /> <Route path={WebsitePaths.Wiki} component={Wiki as any} />
<Route <Route
path={`${WebsitePaths.ZeroExJs}/:version?`} path={`${WebsitePaths.ZeroExJs}/:version?`}
component={LazyZeroExJSDocumentation} component={LazyZeroExJSDocumentation}

View File

@ -1,9 +1,9 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { AboutPageLayout } from 'ts/components/aboutPageLayout'; import { AboutPageLayout } from 'ts/components/aboutPageLayout';
import { DocumentTitle } from 'ts/components/document_title';
import { Link } from 'ts/components/link'; import { Link } from 'ts/components/link';
import { Column, FlexWrap, Section } from 'ts/components/newLayout'; import { Column, FlexWrap, Section } from 'ts/components/newLayout';
import { Heading, Paragraph } from 'ts/components/text'; import { Heading, Paragraph } from 'ts/components/text';
@ -12,6 +12,7 @@ import { colors } from 'ts/style/colors';
import { WebsiteBackendJobInfo } from 'ts/types'; import { WebsiteBackendJobInfo } from 'ts/types';
import { backendClient } from 'ts/utils/backend_client'; import { backendClient } from 'ts/utils/backend_client';
import { constants } from 'ts/utils/constants'; import { constants } from 'ts/utils/constants';
import { documentConstants } from 'ts/utils/document_meta_constants';
const OPEN_POSITIONS_HASH = 'positions'; const OPEN_POSITIONS_HASH = 'positions';
@ -104,7 +105,7 @@ export class NextAboutJobs extends React.Component<NextAboutJobsProps, NextAbout
linkLabel="Our mission and values" linkLabel="Our mission and values"
href={constants.URL_MISSION_AND_VALUES_BLOG_POST} href={constants.URL_MISSION_AND_VALUES_BLOG_POST}
> >
<DocumentTitle title="Jobs at 0x" /> <DocumentTitle {...documentConstants.JOBS} />
<Section bgColor="#F3F6F4" isFlex={true} maxWidth="1170px" wrapWidth="100%"> <Section bgColor="#F3F6F4" isFlex={true} maxWidth="1170px" wrapWidth="100%">
<Column maxWidth="442px"> <Column maxWidth="442px">
<Heading size="medium" marginBottom="30px"> <Heading size="medium" marginBottom="30px">

View File

@ -1,14 +1,15 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { AboutPageLayout } from 'ts/components/aboutPageLayout'; import { AboutPageLayout } from 'ts/components/aboutPageLayout';
import { Definition } from 'ts/components/definition'; import { Definition } from 'ts/components/definition';
import { DocumentTitle } from 'ts/components/document_title';
import { Image } from 'ts/components/image'; import { Image } from 'ts/components/image';
import { Column, Section } from 'ts/components/newLayout'; import { Column, Section } from 'ts/components/newLayout';
import { Heading } from 'ts/components/text'; import { Heading } from 'ts/components/text';
import { constants } from 'ts/utils/constants'; import { constants } from 'ts/utils/constants';
import { documentConstants } from 'ts/utils/document_meta_constants';
const values = [ const values = [
{ {
@ -38,7 +39,7 @@ export const NextAboutMission = () => (
linkLabel="Our mission and values" linkLabel="Our mission and values"
href={constants.URL_MISSION_AND_VALUES_BLOG_POST} href={constants.URL_MISSION_AND_VALUES_BLOG_POST}
> >
<DocumentTitle title="Our Mission - 0x" /> <DocumentTitle {...documentConstants.ABOUT} />
<Section isFullWidth={true} isPadded={false}> <Section isFullWidth={true} isPadded={false}>
<FullWidthImage> <FullWidthImage>
<Image src="/images/about/about-office.png" alt="0x Offices" isCentered={true} /> <Image src="/images/about/about-office.png" alt="0x Offices" isCentered={true} />

View File

@ -1,12 +1,13 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { AboutPageLayout } from 'ts/components/aboutPageLayout'; import { AboutPageLayout } from 'ts/components/aboutPageLayout';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { DocumentTitle } from 'ts/components/document_title';
import { Column, FlexWrap } from 'ts/components/newLayout'; import { Column, FlexWrap } from 'ts/components/newLayout';
import { Paragraph } from 'ts/components/text'; import { Paragraph } from 'ts/components/text';
import { documentConstants } from 'ts/utils/document_meta_constants';
interface HighlightProps { interface HighlightProps {
logo: string; logo: string;
@ -66,7 +67,7 @@ export const NextAboutPress = () => (
</> </>
} }
> >
<DocumentTitle title="Press Highlights - 0x" /> <DocumentTitle {...documentConstants.PRESS} />
</AboutPageLayout> </AboutPageLayout>
); );

View File

@ -1,14 +1,15 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { colors } from 'ts/style/colors'; import { colors } from 'ts/style/colors';
import { AboutPageLayout } from 'ts/components/aboutPageLayout'; import { AboutPageLayout } from 'ts/components/aboutPageLayout';
import { DocumentTitle } from 'ts/components/document_title';
import { Column, Section } from 'ts/components/newLayout'; import { Column, Section } from 'ts/components/newLayout';
import { Heading, Paragraph } from 'ts/components/text'; import { Heading, Paragraph } from 'ts/components/text';
import { WebsitePaths } from 'ts/types'; import { WebsitePaths } from 'ts/types';
import { documentConstants } from 'ts/utils/document_meta_constants';
interface TeamMember { interface TeamMember {
name: string; name: string;
@ -194,7 +195,7 @@ export const NextAboutTeam = () => (
linkLabel="Join the team" linkLabel="Join the team"
to={WebsitePaths.AboutJobs} to={WebsitePaths.AboutJobs}
> >
<DocumentTitle title="Our Team - 0x" /> <DocumentTitle {...documentConstants.TEAM} />
<Section maxWidth="1170px" wrapWidth="100%" isFlex={true} flexBreakpoint="900px"> <Section maxWidth="1170px" wrapWidth="100%" isFlex={true} flexBreakpoint="900px">
<Column> <Column>
<Heading size="medium">0x Team</Heading> <Heading size="medium">0x Team</Heading>

View File

@ -4,11 +4,13 @@ import * as React from 'react';
import { Banner } from 'ts/components/banner'; import { Banner } from 'ts/components/banner';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { CenteredDefinition } from 'ts/components/centeredDefinition'; import { CenteredDefinition } from 'ts/components/centeredDefinition';
import { DocumentTitle } from 'ts/components/document_title';
import { Hero } from 'ts/components/hero'; import { Hero } from 'ts/components/hero';
import { ModalContact, ModalContactType } from 'ts/components/modals/modal_contact'; import { ModalContact, ModalContactType } from 'ts/components/modals/modal_contact';
import { FlexWrap, Section } from 'ts/components/newLayout'; import { FlexWrap, Section } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
import { Heading } from 'ts/components/text'; import { Heading } from 'ts/components/text';
import { documentConstants } from 'ts/utils/document_meta_constants';
export interface CreditsProps {} export interface CreditsProps {}
@ -24,6 +26,7 @@ export class Credits extends React.Component<CreditsProps> {
public render(): React.ReactNode { public render(): React.ReactNode {
return ( return (
<SiteWrap theme="light"> <SiteWrap theme="light">
<DocumentTitle {...documentConstants.INFRASTRUCTURE_CREDITS} />
<Hero <Hero
maxWidth="865px" maxWidth="865px"
maxWidthHeading="765px" maxWidthHeading="765px"

View File

@ -1,8 +1,8 @@
import { colors, constants as sharedConstants, utils as sharedUtils } from '@0x/react-shared'; import { colors, constants as sharedConstants, utils as sharedUtils } from '@0x/react-shared';
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { DocumentTitle } from 'ts/components/document_title';
import { DocsLogo } from 'ts/components/documentation/docs_logo'; import { DocsLogo } from 'ts/components/documentation/docs_logo';
import { DocsTopBar } from 'ts/components/documentation/docs_top_bar'; import { DocsTopBar } from 'ts/components/documentation/docs_top_bar';
import { Container } from 'ts/components/ui/container'; import { Container } from 'ts/components/ui/container';
@ -10,6 +10,7 @@ import { Dispatcher } from 'ts/redux/dispatcher';
import { media } from 'ts/style/media'; import { media } from 'ts/style/media';
import { styled } from 'ts/style/theme'; import { styled } from 'ts/style/theme';
import { BrowserType, OperatingSystemType, ScreenWidths } from 'ts/types'; import { BrowserType, OperatingSystemType, ScreenWidths } from 'ts/types';
import { documentConstants } from 'ts/utils/document_meta_constants';
import { Translate } from 'ts/utils/translate'; import { Translate } from 'ts/utils/translate';
import { utils } from 'ts/utils/utils'; import { utils } from 'ts/utils/utils';
@ -140,7 +141,7 @@ export class DevelopersPage extends React.Component<DevelopersPageProps, Develop
colors.white colors.white
} 50%, ${colors.white} 100%)`} } 50%, ${colors.white} 100%)`}
> >
<DocumentTitle title="0x Docs" /> <DocumentTitle {...documentConstants.DOCS} />
<Helmet> <Helmet>
<link rel="stylesheet" href="/css/github-gist.css" /> <link rel="stylesheet" href="/css/github-gist.css" />
</Helmet> </Helmet>

View File

@ -1,16 +1,17 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { colors } from 'ts/style/colors'; import { colors } from 'ts/style/colors';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { DocumentTitle } from 'ts/components/document_title';
import { Icon } from 'ts/components/icon'; import { Icon } from 'ts/components/icon';
import { Column, Section, WrapGrid } from 'ts/components/newLayout'; import { Column, Section, WrapGrid } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
import { Heading, Paragraph } from 'ts/components/text'; import { Heading, Paragraph } from 'ts/components/text';
import { constants } from 'ts/utils/constants'; import { constants } from 'ts/utils/constants';
import { documentConstants } from 'ts/utils/document_meta_constants';
interface BenefitProps { interface BenefitProps {
title: string; title: string;
@ -55,7 +56,7 @@ const benefits: BenefitProps[] = [
export const NextEcosystem = () => ( export const NextEcosystem = () => (
<SiteWrap theme="light"> <SiteWrap theme="light">
<DocumentTitle title="Ecosystem Acceleration Program: Jumpstart your Business on 0x" /> <DocumentTitle {...documentConstants.ECOSYSTEM_PROGRAM} />
<Section isTextCentered={true}> <Section isTextCentered={true}>
<Column> <Column>
<Heading size="medium" isCentered={true}> <Heading size="medium" isCentered={true}>

View File

@ -1,7 +1,7 @@
import { colors, Styles } from '@0x/react-shared'; import { colors, Styles } from '@0x/react-shared';
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import * as DocumentTitle from 'react-document-title'; import { DocumentTitle } from 'ts/components/document_title';
import { Footer } from 'ts/components/old_footer'; import { Footer } from 'ts/components/old_footer';
import { TopBar } from 'ts/components/top_bar/top_bar'; import { TopBar } from 'ts/components/top_bar/top_bar';
import { Question } from 'ts/pages/faq/question'; import { Question } from 'ts/pages/faq/question';
@ -9,6 +9,7 @@ import { Dispatcher } from 'ts/redux/dispatcher';
import { FAQQuestion, FAQSection, WebsitePaths } from 'ts/types'; import { FAQQuestion, FAQSection, WebsitePaths } from 'ts/types';
import { configs } from 'ts/utils/configs'; import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants'; import { constants } from 'ts/utils/constants';
import { documentConstants } from 'ts/utils/document_meta_constants';
import { Translate } from 'ts/utils/translate'; import { Translate } from 'ts/utils/translate';
export interface FAQProps { export interface FAQProps {
@ -412,7 +413,7 @@ export class FAQ extends React.Component<FAQProps, FAQState> {
public render(): React.ReactNode { public render(): React.ReactNode {
return ( return (
<div> <div>
<DocumentTitle title="0x FAQ" /> <DocumentTitle {...documentConstants.FAQ} />
<TopBar blockchainIsLoaded={false} location={this.props.location} translate={this.props.translate} /> <TopBar blockchainIsLoaded={false} location={this.props.location} translate={this.props.translate} />
<div id="faq" className="mx-auto max-width-4 pt4" style={{ color: colors.grey800 }}> <div id="faq" className="mx-auto max-width-4 pt4" style={{ color: colors.grey800 }}>
<h1 className="center" style={{ ...styles.thin }}> <h1 className="center" style={{ ...styles.thin }}>

View File

@ -1,11 +1,11 @@
import { BigNumber } from '@0x/utils'; import { BigNumber } from '@0x/utils';
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { Banner } from 'ts/components/banner'; import { Banner } from 'ts/components/banner';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { DocumentTitle } from 'ts/components/document_title';
import { ModalContact } from 'ts/components/modals/modal_contact'; import { ModalContact } from 'ts/components/modals/modal_contact';
import { Column, FlexWrap, Section } from 'ts/components/newLayout'; import { Column, FlexWrap, Section } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
@ -17,6 +17,7 @@ import { VoteInfo, VoteValue } from 'ts/pages/governance/vote_form';
import { VoteStats } from 'ts/pages/governance/vote_stats'; import { VoteStats } from 'ts/pages/governance/vote_stats';
import { colors } from 'ts/style/colors'; import { colors } from 'ts/style/colors';
import { configs } from 'ts/utils/configs'; import { configs } from 'ts/utils/configs';
import { documentConstants } from 'ts/utils/document_meta_constants';
import { utils } from 'ts/utils/utils'; import { utils } from 'ts/utils/utils';
interface LabelInterface { interface LabelInterface {
@ -109,7 +110,7 @@ export class Governance extends React.Component {
const { isVoteReceived, tally } = this.state; const { isVoteReceived, tally } = this.state;
return ( return (
<SiteWrap theme="dark"> <SiteWrap theme="dark">
<DocumentTitle title="Governance Vote - 0x" /> <DocumentTitle {...documentConstants.VOTE} />
<Section maxWidth="1170px" isFlex={true}> <Section maxWidth="1170px" isFlex={true}>
<Column width="55%" maxWidth="560px"> <Column width="55%" maxWidth="560px">
<Countdown deadline={proposalData.votingDeadline} /> <Countdown deadline={proposalData.votingDeadline} />

View File

@ -1,12 +1,12 @@
import { utils as sharedUtils } from '@0x/react-shared'; import { utils as sharedUtils } from '@0x/react-shared';
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled, { keyframes } from 'styled-components'; import styled, { keyframes } from 'styled-components';
import { Banner } from 'ts/components/banner'; import { Banner } from 'ts/components/banner';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { Definition } from 'ts/components/definition'; import { Definition } from 'ts/components/definition';
import { DocumentTitle } from 'ts/components/document_title';
import { Hero } from 'ts/components/hero'; import { Hero } from 'ts/components/hero';
import { Section, SectionProps } from 'ts/components/newLayout'; import { Section, SectionProps } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
@ -14,6 +14,7 @@ import { Heading, Paragraph } from 'ts/components/text';
import { Configurator } from 'ts/pages/instant/configurator'; import { Configurator } from 'ts/pages/instant/configurator';
import { colors } from 'ts/style/colors'; import { colors } from 'ts/style/colors';
import { WebsitePaths } from 'ts/types'; import { WebsitePaths } from 'ts/types';
import { documentConstants } from 'ts/utils/document_meta_constants';
import { utils } from 'ts/utils/utils'; import { utils } from 'ts/utils/utils';
import { ModalContact } from '../components/modals/modal_contact'; import { ModalContact } from '../components/modals/modal_contact';
@ -88,7 +89,7 @@ export class Next0xInstant extends React.Component<Props> {
public render(): React.ReactNode { public render(): React.ReactNode {
return ( return (
<SiteWrap> <SiteWrap>
<DocumentTitle title="0x Instant: Quick and secure crypto purchasing" /> <DocumentTitle {...documentConstants.INSTANT} />
<Hero <Hero
title="Introducing 0x Instant" title="Introducing 0x Instant"
description="A free and flexible way to offer simple crypto purchasing in any app or website" description="A free and flexible way to offer simple crypto purchasing in any app or website"

View File

@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import { DocumentTitle } from 'ts/components/document_title';
import { SectionLandingAbout } from 'ts/components/sections/landing/about'; import { SectionLandingAbout } from 'ts/components/sections/landing/about';
import { SectionLandingClients } from 'ts/components/sections/landing/clients'; import { SectionLandingClients } from 'ts/components/sections/landing/clients';
import { SectionLandingCta } from 'ts/components/sections/landing/cta'; import { SectionLandingCta } from 'ts/components/sections/landing/cta';
@ -8,6 +8,7 @@ import { SectionLandingHero } from 'ts/components/sections/landing/hero';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
import { ModalContact } from 'ts/components/modals/modal_contact'; import { ModalContact } from 'ts/components/modals/modal_contact';
import { documentConstants } from 'ts/utils/document_meta_constants';
interface Props { interface Props {
theme: { theme: {
@ -24,7 +25,7 @@ export class NextLanding extends React.Component<Props> {
public render(): React.ReactNode { public render(): React.ReactNode {
return ( return (
<SiteWrap theme="dark"> <SiteWrap theme="dark">
<DocumentTitle title="0x: The protocol for trading tokens on Ethereum" /> <DocumentTitle {...documentConstants.LANDING} />
<SectionLandingHero /> <SectionLandingHero />
<SectionLandingAbout /> <SectionLandingAbout />
<SectionLandingClients /> <SectionLandingClients />

View File

@ -1,17 +1,15 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import { Hero } from 'ts/components/hero';
import { Banner } from 'ts/components/banner'; import { Banner } from 'ts/components/banner';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { Definition } from 'ts/components/definition'; import { Definition } from 'ts/components/definition';
import { DocumentTitle } from 'ts/components/document_title';
import { Hero } from 'ts/components/hero';
import { Icon } from 'ts/components/icon'; import { Icon } from 'ts/components/icon';
import { SiteWrap } from 'ts/components/siteWrap';
import { Section } from 'ts/components/newLayout'; import { Section } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap';
import { constants } from 'ts/utils/constants'; import { constants } from 'ts/utils/constants';
import { documentConstants } from 'ts/utils/document_meta_constants';
import { ModalContact } from '../components/modals/modal_contact'; import { ModalContact } from '../components/modals/modal_contact';
@ -36,7 +34,7 @@ export class NextLaunchKit extends React.Component {
public render(): React.ReactNode { public render(): React.ReactNode {
return ( return (
<SiteWrap theme="dark"> <SiteWrap theme="dark">
<DocumentTitle title="0x Launch Kit: Launch a relayer in under a minute" /> <DocumentTitle {...documentConstants.LAUNCH_KIT} />
<Hero <Hero
isLargeTitle={false} isLargeTitle={false}
isFullWidth={false} isFullWidth={false}

View File

@ -5,12 +5,14 @@ import * as React from 'react';
import { Banner } from 'ts/components/banner'; import { Banner } from 'ts/components/banner';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { Action, Definition } from 'ts/components/definition'; import { Action, Definition } from 'ts/components/definition';
import { DocumentTitle } from 'ts/components/document_title';
import { Hero } from 'ts/components/hero'; import { Hero } from 'ts/components/hero';
import { ModalContact, ModalContactType } from 'ts/components/modals/modal_contact'; import { ModalContact, ModalContactType } from 'ts/components/modals/modal_contact';
import { Section } from 'ts/components/newLayout'; import { Section } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
import { colors } from 'ts/style/colors'; import { colors } from 'ts/style/colors';
import { WebsitePaths } from 'ts/types'; import { WebsitePaths } from 'ts/types';
import { documentConstants } from 'ts/utils/document_meta_constants';
interface OfferData { interface OfferData {
icon: string; icon: string;
@ -66,6 +68,7 @@ export class NextMarketMaker extends React.Component<NextMarketMakerProps> {
public render(): React.ReactNode { public render(): React.ReactNode {
return ( return (
<SiteWrap theme="light"> <SiteWrap theme="light">
<DocumentTitle {...documentConstants.MARKET_MAKER_PROGRAM} />
<Hero <Hero
maxWidth="865px" maxWidth="865px"
maxWidthHeading="715px" maxWidthHeading="715px"

View File

@ -1,17 +1,18 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import styled from 'styled-components'; import styled from 'styled-components';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { DocumentTitle } from 'ts/components/document_title';
import { Column, Section } from 'ts/components/newLayout'; import { Column, Section } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
import { Heading, Paragraph } from 'ts/components/text'; import { Heading, Paragraph } from 'ts/components/text';
import { constants } from 'ts/utils/constants'; import { constants } from 'ts/utils/constants';
import { documentConstants } from 'ts/utils/document_meta_constants';
export const VotePlaceholder = () => ( export const VotePlaceholder = () => (
<SiteWrap> <SiteWrap>
<DocumentTitle title="0x Vote" /> <DocumentTitle {...documentConstants.VOTE} />
<Section isTextCentered={true} isPadded={true} padding="150px 0px"> <Section isTextCentered={true} isPadded={true} padding="150px 0px">
<Column> <Column>
<Heading size="medium" isCentered={true}> <Heading size="medium" isCentered={true}>

View File

@ -1,17 +1,18 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import * as React from 'react'; import * as React from 'react';
import DocumentTitle from 'react-document-title';
import ScrollableAnchor, { configureAnchors } from 'react-scrollable-anchor'; import ScrollableAnchor, { configureAnchors } from 'react-scrollable-anchor';
import styled from 'styled-components'; import styled from 'styled-components';
import { Banner } from 'ts/components/banner'; import { Banner } from 'ts/components/banner';
import { Button } from 'ts/components/button'; import { Button } from 'ts/components/button';
import { Definition } from 'ts/components/definition'; import { Definition } from 'ts/components/definition';
import { DocumentTitle } from 'ts/components/document_title';
import { Hero } from 'ts/components/hero'; import { Hero } from 'ts/components/hero';
import { Column, Section, WrapSticky } from 'ts/components/newLayout'; import { Column, Section, WrapSticky } from 'ts/components/newLayout';
import { SiteWrap } from 'ts/components/siteWrap'; import { SiteWrap } from 'ts/components/siteWrap';
import { Slide, Slider } from 'ts/components/slider/slider'; import { Slide, Slider } from 'ts/components/slider/slider';
import { Heading } from 'ts/components/text'; import { Heading } from 'ts/components/text';
import { documentConstants } from 'ts/utils/document_meta_constants';
import { ModalContact } from '../components/modals/modal_contact'; import { ModalContact } from '../components/modals/modal_contact';
@ -99,7 +100,7 @@ export class NextWhy extends React.Component {
); );
return ( return (
<SiteWrap theme="dark"> <SiteWrap theme="dark">
<DocumentTitle title="Features & Benefits - 0x" /> <DocumentTitle {...documentConstants.WHY} />
<Hero <Hero
title="The exchange layer for the crypto economy" title="The exchange layer for the crypto economy"
description="The world's assets are becoming tokenized on public blockchains. 0x Protocol is free, open-source infrastructure that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens." description="The world's assets are becoming tokenized on public blockchains. 0x Protocol is free, open-source infrastructure that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens."

View File

@ -0,0 +1,89 @@
export interface DocumentMetadata {
title: string;
description: string;
keywords: string;
}
export const documentConstants: { [s: string]: DocumentMetadata } = {
LANDING: {
title: '0x: Powering the decentralized exchange of tokens on Ethereum',
description:
'0x is an open protocol that enables the peer-to-peer exchange of assets on the Ethereum blockchain.',
keywords: '',
},
WHY: {
title: '0x: Features and Benefits',
description:
'0x Protocol is free, open-source infrastructure that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens.',
keywords: '',
},
INSTANT: {
title: '0x Instant: Quick and secure crypto purchasing',
description: 'A free and flexible way to offer simple crypto purchasing in any app or website.',
keywords: '',
},
LAUNCH_KIT: {
title: '0x Launch Kit: Launch a relayer in under a minute',
description: 'Launch Kit includes a set of tools and documentation to build a relayer on 0x.',
keywords: '',
},
ABOUT: {
title: '0x: Our Mission and Values',
description:
'As more assets become tokenized, 0x provides the critical exchange layer in a new financial stack that is more efficient, transparent, and equitable than any system in the past.',
keywords: '',
},
TEAM: {
title: '0x: Our Team',
description:
'The 0x Core Team is passionate about accelerating the adoption decentralized technology and believe in its potential to be an equalizing force in the world. Join us and do the most impactful work of your life.',
keywords: '',
},
PRESS: {
title: '0x: Press Highlights',
description: '0x has been featured in major publications such as Forbes, Fortune, VentureBeat, and TechCrunch.',
keywords: '',
},
JOBS: {
title: 'Jobs at 0x',
description:
'Join us in building infrastructure upon which the exchange of all tokenized assets will take place.',
keywords: '',
},
ECOSYSTEM_PROGRAM: {
title: '0x Ecosystem Acceleration Program: Jumpstart your Business on 0x',
description:
'The Ecosystem Acceleration Program gives teams access to a variety of services including funding, dedicated technical support, and recruiting assistance.',
keywords: '',
},
MARKET_MAKER_PROGRAM: {
title: '0x Market Maker Program: Bring liquidity to the markets of the future',
description:
'The Market Making Program provides a set of resources that help onboard MMs to bring liquidity to the 0x network. The Program includes tutorials, monetary incentives, and 1:1 support from the 0x team.',
keywords: '',
},
INFRASTRUCTURE_CREDITS: {
title: '0x Infrastructure Credits: Earn credits for your business on 0x',
description:
'0x has teamed up with a variety of service providers to offer free credits for any project working on 0x in a full-time capacity.',
keywords: '',
},
DOCS: {
title: '0x Documentation',
description:
'0x Protocol is free, open-source infrastructure that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens.',
keywords: '',
},
FAQ: {
title: '0x FAQs: Frequently Asked Questions',
description:
'0x Protocol is free, open-source infrastructure that developers and businesses utilize to build products that enable the purchasing and trading of crypto tokens.',
keywords: '',
},
VOTE: {
title: '0x Governance: Vote on ZEIPs with ZRX',
description:
'0x is an open protocol that is governed by its users. Cast your votes with ZRX on 0x Improvement Proposals.',
keywords: '',
},
};

View File

@ -63,3 +63,55 @@ def test_get_order_info():
assert isinstance(order_info.order_taker_asset_filled_amount, int) assert isinstance(order_info.order_taker_asset_filled_amount, int)
assert order_info.order_taker_asset_filled_amount == 0 assert order_info.order_taker_asset_filled_amount == 0
def test_get_orders_info():
"""Demonstrate Exchange.getOrderInfo()."""
order: Order = {
"makerAddress": "0x0000000000000000000000000000000000000000",
"takerAddress": "0x0000000000000000000000000000000000000000",
"feeRecipientAddress": "0x0000000000000000000000000000000000000000",
"senderAddress": "0x0000000000000000000000000000000000000000",
"makerAssetAmount": 1000000000000000000,
"takerAssetAmount": 1000000000000000000,
"makerFee": 0,
"takerFee": 0,
"expirationTimeSeconds": 12345,
"salt": 12345,
"makerAssetData": (b"\x00") * 20,
"takerAssetData": (b"\x00") * 20,
}
web3_instance = Web3(Web3.HTTPProvider("http://127.0.0.1:8545"))
# false positive from pylint: disable=no-member
contract_address = NETWORK_TO_ADDRESSES[
NetworkId(int(web3_instance.net.version))
].exchange
assert_valid(
order_to_jsdict(order, exchange_address=contract_address),
"/orderSchema",
)
# false positive from pylint: disable=no-member
exchange: datatypes.Contract = web3_instance.eth.contract(
address=to_checksum_address(contract_address),
abi=zero_ex.contract_artifacts.abi_by_name("Exchange"),
)
orders_info = exchange.call().getOrdersInfo([order])
for order_info in orders_info:
order_info = OrderInfo(*order_info)
assert isinstance(order_info.order_status, int)
assert order_info.order_status == 4
assert isinstance(order_info.order_hash, bytes)
assert order_info.order_hash.hex() == generate_order_hash_hex(
order,
exchange_address=NETWORK_TO_ADDRESSES[NetworkId.GANACHE].exchange,
)
assert isinstance(order_info.order_taker_asset_filled_amount, int)
assert order_info.order_taker_asset_filled_amount == 0

View File

@ -168,12 +168,12 @@ setup(
"0x-contract-addresses", "0x-contract-addresses",
"0x-contract-artifacts", "0x-contract-artifacts",
"0x-json-schemas", "0x-json-schemas",
"0x-web3",
"eth-abi", "eth-abi",
"eth_utils", "eth_utils",
"hypothesis>=3.31.2", # HACK! this is web3's dependency! "hypothesis>=3.31.2", # HACK! this is web3's dependency!
# above works around https://github.com/ethereum/web3.py/issues/1179 # above works around https://github.com/ethereum/web3.py/issues/1179
"mypy_extensions", "mypy_extensions",
"web3",
], ],
extras_require={ extras_require={
"dev": [ "dev": [