diff options
author | August Skare <post@augustskare.no> | 2018-11-16 18:05:30 +0800 |
---|---|---|
committer | August Skare <post@augustskare.no> | 2018-11-16 18:05:30 +0800 |
commit | 54bd7df900316504e4403bc94cffd92930a6c763 (patch) | |
tree | 7b386224e5746be65bfddc094cc5b26f7c018e19 /packages/dev-tools-pages/ts/components/List.tsx | |
parent | 5afef5fe820674abfbdf58226ed0a6920b5c74f7 (diff) | |
download | dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.tar dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.tar.gz dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.tar.bz2 dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.tar.lz dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.tar.xz dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.tar.zst dexon-0x-contracts-54bd7df900316504e4403bc94cffd92930a6c763.zip |
fix linting + code syntax for statless components
Diffstat (limited to 'packages/dev-tools-pages/ts/components/List.tsx')
-rw-r--r-- | packages/dev-tools-pages/ts/components/List.tsx | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/packages/dev-tools-pages/ts/components/List.tsx b/packages/dev-tools-pages/ts/components/List.tsx index 5bf6a9a6b..39e80de13 100644 --- a/packages/dev-tools-pages/ts/components/List.tsx +++ b/packages/dev-tools-pages/ts/components/List.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import styled from 'styled-components'; -import { media } from '../variables'; + +import { media } from 'ts/variables'; const StyledList = styled.ul` list-style-type: none; @@ -27,25 +28,23 @@ const StyledItem = styled.li` } :not(:last-child) { margin-bottom: 0.5625rem; - - ${media.small`margin-bottom: 0.375rem`}; + ${media.small` + margin-bottom: 0.375rem + `}; } `; interface ListProps { - items?: Array<string>; + items?: []; children?: React.ReactNode; } -function List(props: ListProps) { - return ( - <StyledList> - {props.children !== undefined - ? props.children - : props.items.map((bullet, index) => <StyledItem key={index}>{bullet}</StyledItem>)} - </StyledList> - ); -} +const List: React.StatelessComponent<ListProps> = props => ( + <StyledList> + {props.children !== undefined + ? props.children + : props.items.map((bullet, index) => <StyledItem key={index}>{bullet}</StyledItem>)} + </StyledList> +); -export default List; export { List, StyledItem as ListItem }; |