diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-07-01 05:25:33 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-07-02 05:50:55 +0800 |
commit | da8cf9981eda4a068c22d0107e07b704afda2584 (patch) | |
tree | f751e276b3b6b6d0f3f53a27327310760ee6aa5d /packages/website/ts/components/ui | |
parent | be64184cfa11dcabd543161b5d7a6726d4e7924d (diff) | |
download | dexon-sol-tools-da8cf9981eda4a068c22d0107e07b704afda2584.tar.gz dexon-sol-tools-da8cf9981eda4a068c22d0107e07b704afda2584.tar.zst dexon-sol-tools-da8cf9981eda4a068c22d0107e07b704afda2584.zip |
Implement simple menu
Diffstat (limited to 'packages/website/ts/components/ui')
-rw-r--r-- | packages/website/ts/components/ui/container.tsx | 1 | ||||
-rw-r--r-- | packages/website/ts/components/ui/drop_down.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/components/ui/simple_menu.tsx | 34 |
3 files changed, 36 insertions, 1 deletions
diff --git a/packages/website/ts/components/ui/container.tsx b/packages/website/ts/components/ui/container.tsx index fb718d731..edbf8814b 100644 --- a/packages/website/ts/components/ui/container.tsx +++ b/packages/website/ts/components/ui/container.tsx @@ -17,6 +17,7 @@ export interface ContainerProps { maxHeight?: StringOrNum; width?: StringOrNum; height?: StringOrNum; + minWidth?: StringOrNum; minHeight?: StringOrNum; isHidden?: boolean; className?: string; diff --git a/packages/website/ts/components/ui/drop_down.tsx b/packages/website/ts/components/ui/drop_down.tsx index 7d900d685..3738e50eb 100644 --- a/packages/website/ts/components/ui/drop_down.tsx +++ b/packages/website/ts/components/ui/drop_down.tsx @@ -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 ( diff --git a/packages/website/ts/components/ui/simple_menu.tsx b/packages/website/ts/components/ui/simple_menu.tsx new file mode 100644 index 000000000..29445c965 --- /dev/null +++ b/packages/website/ts/components/ui/simple_menu.tsx @@ -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> +); |