diff options
author | August Skare <post@augustskare.no> | 2018-11-16 18:28:24 +0800 |
---|---|---|
committer | August Skare <post@augustskare.no> | 2018-11-16 18:28:24 +0800 |
commit | c08108144825c33d8db26053c1d2d41460b09359 (patch) | |
tree | 6f21ce1e6834e0130b0f6063a097014cc1cc671f /packages/website/ts/components/nested_sidebar_menu.tsx | |
parent | 54bd7df900316504e4403bc94cffd92930a6c763 (diff) | |
parent | cabb7432b9a6d4a5bb8da6fc7fe4522d24e4ece5 (diff) | |
download | dexon-0x-contracts-c08108144825c33d8db26053c1d2d41460b09359.tar.gz dexon-0x-contracts-c08108144825c33d8db26053c1d2d41460b09359.tar.zst dexon-0x-contracts-c08108144825c33d8db26053c1d2d41460b09359.zip |
Merge branch 'development' into dev-tools-pages
Diffstat (limited to 'packages/website/ts/components/nested_sidebar_menu.tsx')
-rw-r--r-- | packages/website/ts/components/nested_sidebar_menu.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/website/ts/components/nested_sidebar_menu.tsx b/packages/website/ts/components/nested_sidebar_menu.tsx index db7d55261..4d4bc4617 100644 --- a/packages/website/ts/components/nested_sidebar_menu.tsx +++ b/packages/website/ts/components/nested_sidebar_menu.tsx @@ -4,11 +4,13 @@ import * as _ from 'lodash'; import * as React from 'react'; import { Button } from 'ts/components/ui/button'; import { Text } from 'ts/components/ui/text'; +import { ScreenWidths } from 'ts/types'; export interface NestedSidebarMenuProps { sectionNameToLinks: ObjectMap<ALink[]>; sidebarHeader?: React.ReactNode; shouldReformatMenuItemNames?: boolean; + screenWidth: ScreenWidths; } export const NestedSidebarMenu = (props: NestedSidebarMenuProps) => { @@ -22,7 +24,7 @@ export const NestedSidebarMenu = (props: NestedSidebarMenuProps) => { ...link, title: menuItemTitle, }; - return <MenuItem key={`menu-item-${menuItemTitle}`} link={finalLink} />; + return <MenuItem key={`menu-item-${menuItemTitle}`} link={finalLink} screenWidth={props.screenWidth} />; }); // tslint:disable-next-line:no-unused-variable return ( @@ -44,6 +46,7 @@ export const NestedSidebarMenu = (props: NestedSidebarMenuProps) => { export interface MenuItemProps { link: ALink; + screenWidth: ScreenWidths; } export interface MenuItemState { @@ -70,7 +73,13 @@ export class MenuItem extends React.Component<MenuItemProps, MenuItemState> { borderRadius="4px" padding="0.4em 0.375em" width="100%" - backgroundColor={isActive ? colors.lightLinkBlue : colors.grey100} + backgroundColor={ + isActive + ? colors.lightLinkBlue + : this.props.screenWidth === ScreenWidths.Sm + ? 'white' + : colors.grey100 + } fontSize="14px" textAlign="left" > |