diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-10 18:51:13 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-10 18:56:15 +0800 |
commit | cee29542451d3bf8c99bd08963a2108768072195 (patch) | |
tree | f3d657be53459ce3851fcf9632bd94f32ee80184 /packages/dev-tools-pages/ts/components/list.tsx | |
parent | a8d9263062e586b90ee4c303d3d3aca72e428edc (diff) | |
parent | 686f27a96f0cd749f6315d7edd2bb56cf1819245 (diff) | |
download | dexon-0x-contracts-cee29542451d3bf8c99bd08963a2108768072195.tar.gz dexon-0x-contracts-cee29542451d3bf8c99bd08963a2108768072195.tar.zst dexon-0x-contracts-cee29542451d3bf8c99bd08963a2108768072195.zip |
Merge development
Diffstat (limited to 'packages/dev-tools-pages/ts/components/list.tsx')
-rw-r--r-- | packages/dev-tools-pages/ts/components/list.tsx | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/dev-tools-pages/ts/components/list.tsx b/packages/dev-tools-pages/ts/components/list.tsx new file mode 100644 index 000000000..ffa7c1cf3 --- /dev/null +++ b/packages/dev-tools-pages/ts/components/list.tsx @@ -0,0 +1,50 @@ +import * as _ from 'lodash'; +import * as React from 'react'; +import styled from 'styled-components'; + +import { media } from 'ts/variables'; + +const StyledList = styled.ul` + list-style-type: none; + margin: 0; + padding: 0; + position: relative; +`; + +const StyledItem = styled.li` + position: relative; + padding-left: 1.625rem; + + :before { + content: ''; + border: 1px solid black; + width: 0.625rem; + height: 0.625rem; + display: inline-block; + position: absolute; + margin-top: 2px; + top: 0.3125rem; + left: 0; + transform: rotate(45deg); + } + :not(:last-child) { + margin-bottom: 0.5625rem; + ${media.small` + margin-bottom: 0.375rem; + `}; + } +`; + +interface ListProps { + items?: []; +} + +const List: React.StatelessComponent<ListProps> = props => ( + <StyledList> + {props.children !== undefined + ? props.children + : _.map(props.items, (bullet, index) => <StyledItem key={index}>{bullet}</StyledItem>)} + </StyledList> +); + +export { List, StyledItem as ListItem }; |