aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/relayer_index/relayer_index.tsx
blob: db3cf07b515b4f485f00740e1fbde7c6fee636f9 (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
import { colors, Styles } from '@0xproject/react-shared';
import { GridList } from 'material-ui/GridList';
import * as React from 'react';

import { RelayerGridTile } from 'ts/components/relayer_index/relayer_grid_tile';
import { RelayerInfo } from 'ts/types';

export interface RelayerIndexProps {
    networkId: number;
}

const styles: Styles = {
    root: {
        width: '100%',
    },
    item: {
        backgroundColor: colors.white,
        borderBottomRightRadius: 10,
        borderBottomLeftRadius: 10,
        borderTopRightRadius: 10,
        borderTopLeftRadius: 10,
        boxShadow: `0px 4px 6px ${colors.walletBoxShadow}`,
        overflow: 'hidden',
        padding: 4,
    },
};

// TODO: replace fake data with real, remote data
const topTokens = [
    {
        address: '0x1dad4783cf3fe3085c1426157ab175a6119a04ba',
        decimals: 18,
        iconUrl: '/images/token_icons/makerdao.png',
        isRegistered: true,
        isTracked: true,
        name: 'Maker DAO',
        symbol: 'MKR',
    },
    {
        address: '0x323b5d4c32345ced77393b3530b1eed0f346429d',
        decimals: 18,
        iconUrl: '/images/token_icons/melon.png',
        isRegistered: true,
        isTracked: true,
        name: 'Melon Token',
        symbol: 'MLN',
    },
    {
        address: '0xb18845c260f680d5b9d84649638813e342e4f8c9',
        decimals: 18,
        iconUrl: '/images/token_icons/augur.png',
        isRegistered: true,
        isTracked: true,
        name: 'Augur Reputation Token',
        symbol: 'REP',
    },
];

const relayerInfos: RelayerInfo[] = [
    {
        id: '1',
        headerUrl: '/images/og_image.png',
        name: 'Radar Relay',
        marketShare: 0.5,
        topTokens,
    },
    {
        id: '2',
        headerUrl: '/images/og_image.png',
        name: 'Paradex',
        marketShare: 0.5,
        topTokens,
    },
    {
        id: '3',
        headerUrl: '/images/og_image.png',
        name: 'yo',
        marketShare: 0.5,
        topTokens,
    },
    {
        id: '4',
        headerUrl: '/images/og_image.png',
        name: 'test',
        marketShare: 0.5,
        topTokens,
    },
    {
        id: '5',
        headerUrl: '/images/og_image.png',
        name: 'blahg',
        marketShare: 0.5,
        topTokens,
    },
    {
        id: '6',
        headerUrl: '/images/og_image.png',
        name: 'hello',
        marketShare: 0.5,
        topTokens,
    },
];

const CELL_HEIGHT = 260;
const NUMBER_OF_COLUMNS = 4;
const GRID_PADDING = 16;

export const RelayerIndex: React.StatelessComponent<RelayerIndexProps> = (props: RelayerIndexProps) => {
    return (
        <div style={styles.root}>
            <GridList cellHeight={CELL_HEIGHT} cols={NUMBER_OF_COLUMNS} padding={GRID_PADDING} style={styles.gridList}>
                {relayerInfos.map((relayerInfo: RelayerInfo) => (
                    <RelayerGridTile key={relayerInfo.id} relayerInfo={relayerInfo} networkId={props.networkId} />
                ))}
            </GridList>
        </div>
    );
};