aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/components/footer.tsx
blob: 75944c91005e5e7c11f7b647431e42bd4375e432 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import * as _ from 'lodash';
import * as React from 'react';
import { Link as ReactRouterLink } from 'react-router-dom';
import styled from 'styled-components';

import { colors } from 'ts/style/colors';

import { BREAKPOINTS, Column, Section, Wrap, WrapGrid } from 'ts/@next/components/layout';
import { Logo } from 'ts/@next/components/logo';
import { NewsletterForm } from 'ts/@next/components/newsletter_form';

interface FooterInterface {
}

interface LinkInterface {
    text: string;
    url: string;
    newWindow?: boolean;
}

interface LinkRows {
    heading: string;
    links: LinkInterface[];
}

interface LinkListProps {
    links: LinkInterface[];
}

const linkRows: LinkRows[] = [
    {
        heading: 'Products',
        isOnMobile: true,
        links: [
            { url: '/next/0x-instant', text: '0x Instant' },
            { url: '#', text: '0x Launch Kit' },
        ],
    },
    {
        heading: 'Developers',
        links: [
            { url: '#', text: 'Documentation' },
            { url: '#', text: 'GitHub' },
            { url: '#', text: 'Whitepaper' },
        ],
    },
    {
        heading: 'About',
        isOnMobile: true,
        links: [
            { url: '#', text: 'Mission' },
            { url: '#', text: 'Team' },
            { url: '#', text: 'Jobs' },
            { url: '#', text: 'Press Kit' },
        ],
    },
    {
        heading: 'Community',
        isOnMobile: true,
        links: [
            { url: '#', text: 'Twitter' },
            { url: '#', text: 'Rocket Chat' },
            { url: '#', text: 'Facebook' },
            { url: '#', text: 'Reddit' },
        ],
    },
];

export const Footer: React.StatelessComponent<FooterInterface> = ({}) => (
    <FooterWrap bgColor="#181818" isNoMargin={true} padding={40}>
        <Wrap>
            <FooterColumn width="35%" isNoPadding={true}>
                <Logo isLight={true} />
                <NewsletterForm />
            </FooterColumn>

            <FooterColumn width="55%" isNoPadding={true}>
                <WrapGrid isCentered={false} isWrapped={true}>
                    {_.map(linkRows, (row, index) => (
                        <FooterSectionWrap
                            key={`fc-${index}`}
                            colWidth="1/4"
                            isNoPadding={true}
                            isMobileHidden={!row.isOnMobile}
                        >
                            <RowHeading>
                                {row.heading}
                            </RowHeading>

                            <LinkList links={row.links} />
                        </FooterSectionWrap>
                    ))}
                </WrapGrid>
            </FooterColumn>
        </Wrap>
    </FooterWrap>
);

const LinkList = (props: LinkListProps) => (
  <List>
    {_.map(props.links, (link, index) => (
      <li key={`fl-${index}`}>
        <Link to={link.url}>
          {link.text}
        </Link>
      </li>
    ))}
  </List>
);

const FooterSection = styled.footer`
    padding: 40px 30px 30px 30px;
    margin-top: 30px;
    background-color: #181818;
`;

const FooterWrap = styled(FooterSection)`
    color: ${colors.white};

    @media (min-width: ${BREAKPOINTS.mobile}) {
        height: 350px;
    }
`;

const FooterColumn = styled(Column)`
    @media (min-width: ${BREAKPOINTS.mobile}) {
        width: ${props => props.width};
    }

    @media (max-width: ${BREAKPOINTS.mobile}) {
        display: ${props => props.isMobileHidden && 'none'};
        text-align: left;
    }
`;

const FooterSectionWrap = styled(FooterColumn)`
    @media (max-width: ${BREAKPOINTS.mobile}) {
        width: 50%;
    }
`;

const RowHeading = styled.h3`
    color: ${colors.white};
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 1.25em;
`;

const List = styled.ul`
    li + li {
        margin-top: 8px;
    }
`;

const Link = styled(ReactRouterLink)`
    color: rgba(255, 255, 255, 0.5);
    display: block;
    font-size: 16px;
    line-height: 20px;
    transition: color 0.25s ease-in-out;
    text-decoration: none;

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