aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/ui/simple_menu.tsx
blob: 22414d1011c32abf447b909e99613286fada9e04 (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
import * as _ from 'lodash';
import * as React from 'react';

import { Container } from 'ts/components/ui/container';
import { Text } from 'ts/components/ui/text';
import { colors } from 'ts/style/colors';

export interface SimpleMenuProps {
    minWidth?: number | string;
}

export const SimpleMenu: React.StatelessComponent<SimpleMenuProps> = ({ children, minWidth }) => {
    return (
        <Container
            marginLeft="16px"
            marginRight="16px"
            marginBottom="16px"
            minWidth={minWidth}
            className="flex flex-column"
        >
            {children}
        </Container>
    );
};

export interface SimpleMenuItemProps {
    text: string;
    onClick?: () => void;
}
export const SimpleMenuItem: React.StatelessComponent<SimpleMenuItemProps> = ({ text, onClick }) => (
    <Container marginTop="16px" className="flex flex-column">
        <Text fontSize="14px" fontColor={colors.darkGrey} onClick={onClick} hoverColor={colors.mediumBlue}>
            {text}
        </Text>
    </Container>
);

SimpleMenu.defaultProps = {
    minWidth: '220px',
};