From 35703539d0f2b4ddb3b11d0de8c9634af59ab71f Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Wed, 6 Mar 2019 17:46:50 +0800 Subject: Deploy @dexon-foundation/0x.js --- .../components/dropdowns/developers_drop_down.tsx | 162 ------------------ .../components/dropdowns/dropdown_developers.tsx | 184 --------------------- .../ts/components/dropdowns/dropdown_products.tsx | 48 ------ .../ts/components/dropdowns/network_drop_down.tsx | 40 ----- 4 files changed, 434 deletions(-) delete mode 100644 packages/website/ts/components/dropdowns/developers_drop_down.tsx delete mode 100644 packages/website/ts/components/dropdowns/dropdown_developers.tsx delete mode 100644 packages/website/ts/components/dropdowns/dropdown_products.tsx delete mode 100644 packages/website/ts/components/dropdowns/network_drop_down.tsx (limited to 'packages/website/ts/components/dropdowns') diff --git a/packages/website/ts/components/dropdowns/developers_drop_down.tsx b/packages/website/ts/components/dropdowns/developers_drop_down.tsx deleted file mode 100644 index 079132f2b..000000000 --- a/packages/website/ts/components/dropdowns/developers_drop_down.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import { ALink, colors, Link } from '@0x/react-shared'; -import * as _ from 'lodash'; -import * as React from 'react'; -import { Container } from 'ts/components/ui/container'; -import { DropDown } from 'ts/components/ui/drop_down'; -import { Text } from 'ts/components/ui/text'; -import { Deco, Key, WebsitePaths } from 'ts/types'; -import { constants } from 'ts/utils/constants'; -import { Translate } from 'ts/utils/translate'; - -const gettingStartedKeyToLinkInfo1: ALink[] = [ - { - title: Key.BuildARelayer, - to: `${WebsitePaths.Wiki}#Build-A-Relayer`, - }, - { - title: Key.OrderBasics, - to: `${WebsitePaths.Wiki}#Create,-Validate,-Fill-Order`, - }, -]; -const gettingStartedKeyToLinkInfo2: ALink[] = [ - { - title: Key.DevelopOnEthereum, - to: `${WebsitePaths.Wiki}#Ethereum-Development`, - }, - { - title: Key.UseNetworkedLiquidity, - to: `${WebsitePaths.Wiki}#Find,-Submit,-Fill-Order-From-Relayer`, - }, -]; -const popularDocsToLinkInfos: ALink[] = [ - { - title: Key.ZeroExJs, - to: WebsitePaths.ZeroExJs, - }, - { - title: Key.Connect, - to: WebsitePaths.Connect, - }, - { - title: Key.SmartContract, - to: WebsitePaths.SmartContracts, - }, -]; -const usefulLinksToLinkInfo: ALink[] = [ - { - title: Key.Wiki, - to: WebsitePaths.Wiki, - }, - { - title: Key.Github, - to: constants.URL_GITHUB_ORG, - shouldOpenInNewTab: true, - }, - { - title: Key.ProtocolSpecification, - to: constants.URL_PROTOCOL_SPECIFICATION, - shouldOpenInNewTab: true, - }, -]; - -interface DevelopersDropDownProps { - location: Location; - translate: Translate; - menuItemStyles: React.CSSProperties; - menuIconStyle: React.CSSProperties; -} - -interface DevelopersDropDownState {} - -export class DevelopersDropDown extends React.Component { - public render(): React.ReactNode { - const activeNode = ( - - - {this.props.translate.get(Key.Developers, Deco.Cap)} - - - ); - return ( - - ); - } - private _renderDropdownMenu(): React.ReactNode { - const sectionPadding = '26px'; - const dropdownMenu = ( - - - - {this._renderLinkSection(gettingStartedKeyToLinkInfo1, 'Getting started')} - - {this._renderLinkSection(gettingStartedKeyToLinkInfo2)} - - - - - {this._renderLinkSection(popularDocsToLinkInfos, 'Popular docs')} - - - {this._renderLinkSection(usefulLinksToLinkInfo, 'Useful links')} - - - - - - {this.props.translate.get(Key.ViewAllDocumentation, Deco.Upper)} - - - - - ); - return dropdownMenu; - } - private _renderLinkSection(links: ALink[], title: string = ''): React.ReactNode { - const numLinks = links.length; - let i = 0; - const renderLinks = _.map(links, (link: ALink) => { - const isWikiLink = _.startsWith(link.to, WebsitePaths.Wiki) && _.includes(link.to, '#'); - const isOnWiki = this.props.location.pathname === WebsitePaths.Wiki; - let to = link.to; - if (isWikiLink && isOnWiki) { - to = `${link.to.split('#')[1]}`; - } - i++; - const isLast = i === numLinks; - const linkText = this.props.translate.get(link.title as Key, Deco.Cap); - return ( - - - - {linkText} - - - - ); - }); - return ( - - - {!_.isEmpty(title) && ( - - {title.toUpperCase()} - - )} - - {renderLinks} - - ); - } -} diff --git a/packages/website/ts/components/dropdowns/dropdown_developers.tsx b/packages/website/ts/components/dropdowns/dropdown_developers.tsx deleted file mode 100644 index 590d2ead9..000000000 --- a/packages/website/ts/components/dropdowns/dropdown_developers.tsx +++ /dev/null @@ -1,184 +0,0 @@ -import { Link } from '@0x/react-shared'; -import * as _ from 'lodash'; -import * as React from 'react'; -import styled, { withTheme } from 'styled-components'; - -import { Button } from 'ts/components/button'; -import { Column, FlexWrap, WrapGrid } from 'ts/components/newLayout'; -import { ThemeValuesInterface } from 'ts/components/siteWrap'; -import { Heading } from 'ts/components/text'; -import { WebsitePaths } from 'ts/types'; -import { constants } from 'ts/utils/constants'; - -interface Props { - theme: ThemeValuesInterface; -} - -interface LinkConfig { - label: string; - url: string; - shouldOpenInNewTab?: boolean; -} - -const introData: LinkConfig[] = [ - { - label: 'Build a relayer', - url: `${WebsitePaths.Wiki}#Build-A-Relayer`, - }, - { - label: 'Develop on Ethereum', - url: `${WebsitePaths.Wiki}#Ethereum-Development`, - }, - { - label: 'Make & take orders', - url: `${WebsitePaths.Wiki}#Create,-Validate,-Fill-Order`, - }, - { - label: 'Use networked liquidity', - url: `${WebsitePaths.Wiki}#Find,-Submit,-Fill-Order-From-Relayer`, - }, - { - label: 'Market making', - url: `${WebsitePaths.MarketMaker}`, - }, -]; - -const docsData: LinkConfig[] = [ - { - label: '0x.js', - url: WebsitePaths.ZeroExJs, - }, - { - label: '0x Connect', - url: WebsitePaths.Connect, - }, - { - label: 'Smart Contract', - url: WebsitePaths.SmartContracts, - }, -]; - -const linksData: LinkConfig[] = [ - { - label: 'Wiki', - url: WebsitePaths.Wiki, - }, - { - label: 'Github', - url: constants.URL_GITHUB_ORG, - shouldOpenInNewTab: true, - }, - { - label: 'Protocol specification', - url: constants.URL_PROTOCOL_SPECIFICATION, - shouldOpenInNewTab: true, - }, -]; - -export const DropdownDevelopers: React.FunctionComponent = withTheme((props: Props) => ( - <> - -
- - Getting Started - - - - {_.map(introData, (item, index) => ( -
  • - - {item.label} - -
  • - ))} -
    -
    - - - - - Popular Docs - - -
      - {_.map(docsData, (item, index) => ( -
    • - - {item.label} - -
    • - ))} -
    -
    - - - - Useful Links - - -
      - {_.map(linksData, (item, index) => ( -
    • - - {item.label} - -
    • - ))} -
    -
    -
    - - - View All Documentation - -
    - -)); - -const DropdownWrap = styled.div` - padding: 15px 30px 75px 30px; - - a { - color: inherit; - } - - li { - margin: 8px 0; - } -`; - -const StyledGrid = styled(WrapGrid.withComponent('ul'))` - li { - width: 50%; - flex-shrink: 0; - } -`; - -const StyledWrap = styled(FlexWrap)` - padding-top: 20px; - margin-top: 30px; - position: relative; - - &:before { - content: ''; - width: 100%; - height: 1px; - background-color: ${props => props.theme.dropdownColor}; - opacity: 0.15; - position: absolute; - top: 0; - left: 0; - } -`; - -const StyledLink = styled(Button)` - width: 100%; - position: absolute; - bottom: 0; - left: 0; -`; diff --git a/packages/website/ts/components/dropdowns/dropdown_products.tsx b/packages/website/ts/components/dropdowns/dropdown_products.tsx deleted file mode 100644 index 93fd1a4fe..000000000 --- a/packages/website/ts/components/dropdowns/dropdown_products.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; - -import { Link } from 'react-router-dom'; -import styled from 'styled-components'; -import { Heading, Paragraph } from 'ts/components/text'; -import { WebsitePaths } from 'ts/types'; - -const navData = [ - { - title: '0x Instant', - description: 'Simple crypto purchasing', - url: WebsitePaths.Instant, - }, - { - title: '0x Launch Kit', - description: 'Build on the 0x protocol', - url: WebsitePaths.LaunchKit, - }, -]; - -export const DropdownProducts: React.FunctionComponent<{}> = () => ( - - {_.map(navData, (item, index) => ( -
  • - - - {item.title} - - - {item.description && ( - - {item.description} - - )} - -
  • - ))} -
    -); - -const List = styled.ul` - a { - padding: 15px 30px; - display: block; - color: inherit; - } -`; diff --git a/packages/website/ts/components/dropdowns/network_drop_down.tsx b/packages/website/ts/components/dropdowns/network_drop_down.tsx deleted file mode 100644 index df2d72edc..000000000 --- a/packages/website/ts/components/dropdowns/network_drop_down.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { constants as sharedConstants } from '@0x/react-shared'; -import * as _ from 'lodash'; -import DropDownMenu from 'material-ui/DropDownMenu'; -import MenuItem from 'material-ui/MenuItem'; -import * as React from 'react'; - -interface NetworkDropDownProps { - updateSelectedNetwork: (e: any, index: number, value: number) => void; - selectedNetworkId: number; - avialableNetworkIds: number[]; -} - -interface NetworkDropDownState {} - -export class NetworkDropDown extends React.Component { - public render(): React.ReactNode { - return ( -
    - - {this._renderDropDownItems()} - -
    - ); - } - private _renderDropDownItems(): React.ReactNode { - const items = _.map(this.props.avialableNetworkIds, networkId => { - const networkName = sharedConstants.NETWORK_NAME_BY_ID[networkId]; - const primaryText = ( -
    -
    - -
    -
    {networkName}
    -
    - ); - return ; - }); - return items; - } -} -- cgit v1.2.3