diff --git a/src/component/container/pattern_list.tsx b/src/component/container/pattern_list.tsx index d52805edb..ae9bf5900 100644 --- a/src/component/container/pattern_list.tsx +++ b/src/component/container/pattern_list.tsx @@ -5,6 +5,7 @@ import { action } from 'mobx'; import { observer } from 'mobx-react'; import { PageElement } from '../../store/page/page_element'; import { Pattern } from '../../store/pattern'; +import PatternListItem from '../../lsg/patterns/pattern-list-item'; import * as React from 'react'; import { Store } from '../../store'; @@ -36,7 +37,7 @@ export class PatternList extends React.Component { const list = this.createList(this.items); return (
- + {list}
); @@ -75,20 +76,29 @@ export class PatternList extends React.Component { {items.map((props: ListItemProps, index: number) => { const labelComponent = props.label ? : null; const nextLevel = props.children ? this.createList(props.children) : null; - - return ( -
  • - {labelComponent} - {props.value} - {nextLevel} -
  • - ); + if (nextLevel) { + return ( +
  • + {labelComponent} + {props.value} + {nextLevel} +
  • + ); + } else { + return ( + + {labelComponent} + {props.value} + {nextLevel} + + ); + } })} ); diff --git a/src/lsg/patterns/list/index.tsx b/src/lsg/patterns/list/index.tsx index c374bd4c9..699b852ab 100644 --- a/src/lsg/patterns/list/index.tsx +++ b/src/lsg/patterns/list/index.tsx @@ -37,7 +37,7 @@ export interface LiProps { const StyledUl = styledComponents.ul` box-sizing: border-box; - padding: 0 0 0 15px; + padding: 0; margin: 0; width: 100%; `; diff --git a/src/lsg/patterns/pattern-list-item/index.tsx b/src/lsg/patterns/pattern-list-item/index.tsx index 822cf8318..208d7367d 100644 --- a/src/lsg/patterns/pattern-list-item/index.tsx +++ b/src/lsg/patterns/pattern-list-item/index.tsx @@ -1,11 +1,12 @@ import { colors } from '../colors'; import { fonts } from '../fonts'; import { Icon, IconName, Size as IconSize } from '../icons'; +import { LiProps } from '../list'; import * as React from 'react'; import { getSpace, Size } from '../space'; import styled from 'styled-components'; -export interface PatternListItemProps { +export interface PatternListItemProps extends LiProps { className?: string; icon?: string; } @@ -16,6 +17,7 @@ const StyledPatternListItem = styled.li` cursor: default; padding: ${getSpace(Size.S)}px; border: 1px solid ${colors.grey90.toString()}; + margin: 0 0 ${getSpace(Size.S)}px 0; border-radius: 3px; background: ${colors.white.toString()}; font-family: ${fonts().NORMAL_FONT}; @@ -33,10 +35,10 @@ const StyledIcon = styled(Icon)` `; const PatternListItem: React.StatelessComponent = props => ( - + {props.icon ? - + {props.icon} : }