aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/dropdowns/dropdown_developers.tsx
blob: 590d2ead96c7ea94232cc1964375081dfc8d95df (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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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<Props> = withTheme((props: Props) => (
    <>
        <DropdownWrap>
            <div>
                <Heading asElement="h4" size={14} color="inherit" marginBottom="15px" isMuted={0.35}>
                    Getting Started
                </Heading>

                <StyledGrid isCentered={false} isWrapped={true}>
                    {_.map(introData, (item, index) => (
                        <li>
                            <Link key={`introLink-${index}`} to={item.url}>
                                {item.label}
                            </Link>
                        </li>
                    ))}
                </StyledGrid>
            </div>

            <StyledWrap>
                <Column width="calc(100% - 15px)">
                    <Heading asElement="h4" size={14} color="inherit" marginBottom="15px" isMuted={0.35}>
                        Popular Docs
                    </Heading>

                    <ul>
                        {_.map(docsData, (item, index) => (
                            <li key={`docsLink-${index}`}>
                                <Link to={item.url} shouldOpenInNewTab={item.shouldOpenInNewTab}>
                                    {item.label}
                                </Link>
                            </li>
                        ))}
                    </ul>
                </Column>

                <Column width="calc(100% - 15px)">
                    <Heading asElement="h4" size={14} color="inherit" marginBottom="15px" isMuted={0.35}>
                        Useful Links
                    </Heading>

                    <ul>
                        {_.map(linksData, (item, index) => (
                            <li key={`usefulLink-${index}`}>
                                <Link to={item.url} shouldOpenInNewTab={item.shouldOpenInNewTab}>
                                    {item.label}
                                </Link>
                            </li>
                        ))}
                    </ul>
                </Column>
            </StyledWrap>

            <StyledLink
                to={WebsitePaths.Docs}
                bgColor={props.theme.dropdownButtonBg}
                isAccentColor={true}
                isNoBorder={true}
            >
                View All Documentation
            </StyledLink>
        </DropdownWrap>
    </>
));

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;
`;