aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/portal_menu.tsx
blob: 9ab611556dc6706a2e0164948be1c9efe676663e (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
import * as _ from 'lodash';
import * as React from 'react';
import { MenuItem } from 'ts/components/ui/menu_item';
import { Environments, WebsitePaths } from 'ts/types';
import { configs } from 'ts/utils/configs';

export interface PortalMenuProps {
    menuItemStyle: React.CSSProperties;
    onClick?: () => void;
}

interface PortalMenuState {}

export class PortalMenu extends React.Component<PortalMenuProps, PortalMenuState> {
    public static defaultProps: Partial<PortalMenuProps> = {
        onClick: _.noop,
    };
    public render() {
        return (
            <div>
                <MenuItem
                    style={this.props.menuItemStyle}
                    className="py2"
                    to={`${WebsitePaths.Portal}`}
                    onClick={this.props.onClick.bind(this)}
                >
                    {this._renderMenuItemWithIcon('Generate order', 'zmdi-arrow-right-top')}
                </MenuItem>
                <MenuItem
                    style={this.props.menuItemStyle}
                    className="py2"
                    to={`${WebsitePaths.Portal}/fill`}
                    onClick={this.props.onClick.bind(this)}
                >
                    {this._renderMenuItemWithIcon('Fill order', 'zmdi-arrow-left-bottom')}
                </MenuItem>
                <MenuItem
                    style={this.props.menuItemStyle}
                    className="py2"
                    to={`${WebsitePaths.Portal}/balances`}
                    onClick={this.props.onClick.bind(this)}
                >
                    {this._renderMenuItemWithIcon('Balances', 'zmdi-balance-wallet')}
                </MenuItem>
                <MenuItem
                    style={this.props.menuItemStyle}
                    className="py2"
                    to={`${WebsitePaths.Portal}/trades`}
                    onClick={this.props.onClick.bind(this)}
                >
                    {this._renderMenuItemWithIcon('Trade history', 'zmdi-format-list-bulleted')}
                </MenuItem>
                <MenuItem
                    style={this.props.menuItemStyle}
                    className="py2"
                    to={`${WebsitePaths.Portal}/weth`}
                    onClick={this.props.onClick.bind(this)}
                >
                    {this._renderMenuItemWithIcon('Wrap ETH', 'zmdi-circle-o')}
                </MenuItem>
                {configs.ENVIRONMENT === Environments.DEVELOPMENT && (
                    <MenuItem
                        style={this.props.menuItemStyle}
                        className="py2"
                        to={`${WebsitePaths.Portal}/wallet`}
                        onClick={this.props.onClick.bind(this)}
                    >
                        {this._renderMenuItemWithIcon('Wallet', 'zmdi-balance-wallet')}
                    </MenuItem>
                )}
            </div>
        );
    }
    private _renderMenuItemWithIcon(title: string, iconName: string) {
        return (
            <div className="flex" style={{ fontWeight: 100 }}>
                <div className="pr1 pl2">
                    <i style={{ fontSize: 20 }} className={`zmdi ${iconName}`} />
                </div>
                <div className="pl1">{title}</div>
            </div>
        );
    }
}