aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/components/header.tsx
blob: 0f47588bd3402ec7097087e36e40779621a64ede (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import * as _ from 'lodash';
import * as React from 'react';
import styled from 'styled-components';

import { Link as ReactRouterLink } from 'react-router-dom';

import { Button } from './button';
import { Container } from './container';
import { Logo } from './logo';

interface HeaderProps {
}

interface LinkProps {
    href: string;
}

const links = [
    { url: '/next/why', text: 'Why 0x' },
    { url: '/next/0x-instant', text: 'Products' },
    { url: '#', text: 'Developers' },
    { url: '/next/about/mission', text: 'About' },
    { url: '#', text: 'Blog' },
];

const Link: React.StatelessComponent<LinkProps> = props => {
    const { children, href } = props;

    return (
        <StyledRouterLink
            to={href}
        >
            {children}
        </StyledRouterLink>
    );
};

export const Header: React.StatelessComponent<HeaderProps> = ({}) => (
    <Container>
        <StyledHeader>
            <Logo/>
            <Links>
                {_.map(links, (link, index) => <Link key={index} href={link.url}>{link.text}</Link>)}
            </Links>
            <TradeButton href="#">Trade on 0x</TradeButton>
        </StyledHeader>
    </Container>
);

const StyledHeader = styled.header`
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    align-items: center;
    justify-content: space-between;
    padding: 1.666666667rem 0;
`;

const TradeButton = styled(Button)`
    @media (max-width: 999px) {
        display: none;
    }
`;

const Links = styled.div`
    display: flex;
    justify-content: space-around;
`;

const StyledRouterLink = styled(ReactRouterLink)`
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    margin: 0 1.666666667em;
    transition: color 0.25s ease-in-out;
    text-decoration: none;

    &:hover {
        color: rgba(255, 255, 255, 1);
    }
`;