Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Mar 22, 2018
1 parent d92ed42 commit 4b15a17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
25 changes: 15 additions & 10 deletions src/components/SideMenu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@ export class MenuItem extends React.Component<MenuItemProps> {
render() {
const { item, withoutChildren } = this.props;
return (
<MenuItemLi onClick={this.activate} depth={item.depth} innerRef={this.saveRef} data-item-id={item.id}>
<MenuItemLi
onClick={this.activate}
depth={item.depth}
innerRef={this.saveRef}
data-item-id={item.id}
>
{item.type === 'operation' ? (
<OperationMenuItemContent item={item as OperationModel} />
) : (
<MenuItemLabel depth={item.depth} active={item.active} type={item.type}>
<MenuItemTitle title={item.name}>{item.name}</MenuItemTitle>
{(item.depth > 0 &&
item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.active ? 'down' : 'right'} />
)) ||
null}
</MenuItemLabel>
)}
<MenuItemLabel depth={item.depth} active={item.active} type={item.type}>
<MenuItemTitle title={item.name}>{item.name}</MenuItemTitle>
{(item.depth > 0 &&
item.items.length > 0 && (
<ShelfIcon float={'right'} direction={item.active ? 'down' : 'right'} />
)) ||
null}
</MenuItemLabel>
)}
{!withoutChildren &&
item.items &&
item.items.length > 0 && (
Expand Down
13 changes: 7 additions & 6 deletions src/components/SideMenu/styled.elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled, { css, withProps } from '../../styled-components';

export const OperationBadge = withProps<{ type: string }>(styled.span).attrs({
className: props => `operation-type ${props.type}`,
}) `
})`
width: 26px;
display: inline-block;
height: ${props => props.theme.code.fontSize};;
Expand Down Expand Up @@ -70,7 +70,7 @@ function menuItemActiveBg(depth): string {
}
}

export const MenuItemUl = withProps<{ active: boolean }>(styled.ul) `
export const MenuItemUl = withProps<{ active: boolean }>(styled.ul)`
margin: 0;
padding: 0;
Expand All @@ -81,7 +81,7 @@ export const MenuItemUl = withProps<{ active: boolean }>(styled.ul) `
${props => (props.active ? '' : 'display: none;')};
`;

export const MenuItemLi = withProps<{ depth: number }>(styled.li) `
export const MenuItemLi = withProps<{ depth: number }>(styled.li)`
list-style: none inside none;
overflow: hidden;
text-overflow: ellipsis;
Expand Down Expand Up @@ -121,12 +121,13 @@ export const MenuItemLabel = withProps<{
classnames('-depth' + props.depth, {
active: props.active,
}),
}) `
})`
cursor: pointer;
color: ${props => (props.active ? props.theme.colors.main : props.theme.colors.text)};
margin: 0;
padding: 12.5px ${props => props.theme.spacingUnit}px;
${({ depth, type, theme }) => type === 'section' && depth > 1 && 'padding-left: ' + theme.spacingUnit * 2 + 'px;' || ''}
${({ depth, type, theme }) =>
(type === 'section' && depth > 1 && 'padding-left: ' + theme.spacingUnit * 2 + 'px;') || ''}
display: flex;
justify-content: space-between;
font-family: ${props => props.theme.headingsFont.family};
Expand All @@ -140,7 +141,7 @@ export const MenuItemLabel = withProps<{
}
`;

export const MenuItemTitle = withProps<{ width?: string }>(styled.span) `
export const MenuItemTitle = withProps<{ width?: string }>(styled.span)`
display: inline-block;
vertical-align: middle;
width: ${props => (props.width ? props.width : 'auto')};
Expand Down

0 comments on commit 4b15a17

Please sign in to comment.