From e18be3160e5d35f478157d525e8ec9f91d06fe38 Mon Sep 17 00:00:00 2001 From: Ezekiel Aquino Date: Mon, 10 Dec 2018 20:02:28 +0100 Subject: WIP dropdown header --- packages/website/package.json | 1 + .../components/dropdowns/dropdown_developers.tsx | 37 ++++++++++ .../components/dropdowns/dropdown_products.tsx | 39 ++++++++++ packages/website/ts/@next/components/header.tsx | 83 ++++++++++++---------- 4 files changed, 122 insertions(+), 38 deletions(-) create mode 100644 packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx create mode 100644 packages/website/ts/@next/components/dropdowns/dropdown_products.tsx (limited to 'packages/website') diff --git a/packages/website/package.json b/packages/website/package.json index 0f70a4543..9e1d97508 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -57,6 +57,7 @@ "react-copy-to-clipboard": "^5.0.0", "react-document-title": "^2.0.3", "react-dom": "^16.4.2", + "react-headroom": "^2.2.4", "react-helmet": "^5.2.0", "react-lazyload": "^2.3.0", "react-loadable": "^5.5.0", diff --git a/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx b/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx new file mode 100644 index 000000000..a9cfed538 --- /dev/null +++ b/packages/website/ts/@next/components/dropdowns/dropdown_developers.tsx @@ -0,0 +1,37 @@ +import * as React from 'react'; +import styled from 'styled-components'; + +import {Link} from 'react-router-dom'; +import {WrapGrid} from 'ts/@next/components/layout'; +import {Heading} from 'ts/@next/components/text'; + +export const DropdownDevelopers = () => ( + <> + + + Getting Started + + + + Build a relayer + Develop on Ethereum + Make & take orders + Use networked liquidity + + + + + asdf + + +); + +const Wrap = styled.div` + padding: 15px 30px; +`; + +const StyledLink = styled(Link)` + width: calc(50% - 15px); + flex-shrink: 0; + color: #000000; +`; diff --git a/packages/website/ts/@next/components/dropdowns/dropdown_products.tsx b/packages/website/ts/@next/components/dropdowns/dropdown_products.tsx new file mode 100644 index 000000000..366c00a1e --- /dev/null +++ b/packages/website/ts/@next/components/dropdowns/dropdown_products.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import styled from 'styled-components'; +import {Heading, Paragraph} from 'ts/@next/components/text'; + +export const DropdownProducts = () => ( + +
  • + + 0x Instant + + + + Simple crypto purchasing + +
  • + +
  • + + 0x Launch Kit + + + + Build on the 0x protocol + +
  • + +
  • + + Extensions + +
  • +
    +); + +const List = styled.ul` + li { + padding: 15px 30px; + } +`; diff --git a/packages/website/ts/@next/components/header.tsx b/packages/website/ts/@next/components/header.tsx index 99e634e18..6444a1b97 100644 --- a/packages/website/ts/@next/components/header.tsx +++ b/packages/website/ts/@next/components/header.tsx @@ -1,5 +1,6 @@ import _ from 'lodash'; import * as React from 'react'; +import Headroom from 'react-headroom'; import { Link as ReactRouterLink } from 'react-router-dom'; import styled from 'styled-components'; @@ -7,6 +8,8 @@ import { colors } from 'ts/style/colors'; import { Button, ButtonWrap, Link } from 'ts/@next/components/button'; import { DevelopersDropDown } from 'ts/@next/components/dropdowns/developers_drop_down'; +import { DropdownDevelopers } from 'ts/@next/components/dropdowns/dropdown_developers'; +import { DropdownProducts } from 'ts/@next/components/dropdowns/dropdown_products'; import { Dropdown } from 'ts/@next/components/dropdowns/mock'; import { Hamburger } from 'ts/@next/components/hamburger'; import { Section, Wrap } from 'ts/@next/components/layout'; @@ -43,56 +46,56 @@ const navItems: NavItem[] = [ id: 'products', url: '/next/0x-instant', text: 'Products', - dropdownComponent: Dropdown, + dropdownComponent: DropdownProducts, }, { id: 'developers', url: '#', text: 'Developers', - dropdownComponent: Dropdown, + dropdownComponent: DropdownDevelopers, }, { id: 'about', url: '/next/about/mission', text: 'About' }, { id: 'blog', url: '#', text: 'Blog' }, ]; export class Header extends React.Component { - constructor(props: HeaderProps) { - super(props); - this.state = { - isOpen: false, - }; - } + public state = { + isOpen: false, + }; + public render(): React.ReactNode { return ( - - - - - - - - - - Trade on 0x - - + + + + + + + + + + + Trade on 0x + + + ); } private _onMenuButtonClick(): void { @@ -135,6 +138,10 @@ const StyledHeader = styled(Section.withComponent('header'))` padding: 20px 20px 0 !important; } } + + @media (min-width: 768px) { + background-color: ${props => props.theme.bgColor}; + } `; const HeaderWrap = styled(Wrap)` @@ -207,7 +214,7 @@ const LinkWrap = styled.div` const DropdownWrap = styled.div` width: 420px; - padding: 30px; + padding: 15px 0; background-color: #ffffff; color: #000000; position: absolute; -- cgit