Implement simple menu

This commit is contained in:
Brandon Millman
2018-06-30 14:25:33 -07:00
parent be64184cfa
commit da8cf9981e
5 changed files with 50 additions and 91 deletions

View File

@@ -17,6 +17,7 @@ export interface ContainerProps {
maxHeight?: StringOrNum;
width?: StringOrNum;
height?: StringOrNum;
minWidth?: StringOrNum;
minHeight?: StringOrNum;
isHidden?: boolean;
className?: string;

View File

@@ -49,7 +49,7 @@ export class DropDown extends React.Component<DropDownProps, DropDownState> {
// call hoverOff whenever the dropdown receives updated props. This is a hack
// because it will effectively close the dropdown on any prop update, barring
// dropdowns from having dynamic content.
this._onHoverOff();
// this._onHoverOff();
}
public render(): React.ReactNode {
return (

View File

@@ -0,0 +1,34 @@
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 {}
export const SimpleMenu: React.StatelessComponent<SimpleMenuProps> = ({ children }) => {
return (
<Container
marginLeft="16px"
marginRight="16px"
marginBottom="16px"
minWidth="220px"
className="flex flex-column"
>
{children}
</Container>
);
};
export interface SimpleMenuItemProps {
text: string;
onClick?: () => void;
}
export const SimpleMenuItem: React.StatelessComponent<SimpleMenuItemProps> = ({ text, onClick }) => (
<Container marginTop="16px" minWidth="220px" className="flex flex-column">
<Text fontSize="14px" fontColor={colors.darkGrey} onClick={onClick} hoverColor={colors.mediumBlue}>
{text}
</Text>
</Container>
);