aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/header.tsx
blob: 2787692c11a6b62e4e15ddfdbe79a6e48ab3d61c (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
import * as React from 'react';
import styled from 'styled-components';

import { ContextInterface, ThemeContext } from 'ts/context';
import { media } from 'ts/variables';

import { Container } from './container';
import { Small } from './typography';

const Header: React.StatelessComponent<{}> = () => (
    <ThemeContext.Consumer>
        {({ icon, title }: ContextInterface) => (
            <StyledHeader>
                <Container>
                    <LogoMark>
                        <Logo as={icon as 'svg'} />
                        <Title>{title}</Title>
                    </LogoMark>

                    <Link as="a" href="https://0xproject.com/">
                        Built by 0x
                    </Link>
                </Container>
            </StyledHeader>
        )}
    </ThemeContext.Consumer>
);

const StyledHeader = styled.header`
    padding-top: 3.75rem;
    padding-bottom: 0.875rem;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    ${Container} {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    ${media.small`padding-top: 2.125rem;`};
`;

const LogoMark = styled.div`
    position: relative;
    height: 1.75rem;
    display: flex;
    align-items: center;
`;

const Logo = styled.div`
    color: ${props => props.theme.colors.main};
    width: 1.75rem;
    height: 100%;
`;

const Title = styled.h1`
    font-size: 1.5rem;
    line-height: 1;
    white-space: nowrap;
    margin-top: 2px;
    margin-bottom: 0;
    margin-left: 0.8125rem;

    ${media.small`font-size: 1.25rem;`};
`;

const Link = styled(Small)`
    :hover {
        text-decoration: underline;
    }
`;

export { Header };