Implement simple menu
This commit is contained in:
@@ -17,6 +17,7 @@ export interface ContainerProps {
|
||||
maxHeight?: StringOrNum;
|
||||
width?: StringOrNum;
|
||||
height?: StringOrNum;
|
||||
minWidth?: StringOrNum;
|
||||
minHeight?: StringOrNum;
|
||||
isHidden?: boolean;
|
||||
className?: string;
|
||||
|
||||
@@ -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 (
|
||||
|
||||
34
packages/website/ts/components/ui/simple_menu.tsx
Normal file
34
packages/website/ts/components/ui/simple_menu.tsx
Normal 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>
|
||||
);
|
||||
Reference in New Issue
Block a user