aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/ContentBlock.tsx
diff options
context:
space:
mode:
authorAugust Skare <post@augustskare.no>2018-11-16 18:05:30 +0800
committerAugust Skare <post@augustskare.no>2018-11-16 18:05:30 +0800
commit54bd7df900316504e4403bc94cffd92930a6c763 (patch)
tree7b386224e5746be65bfddc094cc5b26f7c018e19 /packages/dev-tools-pages/ts/components/ContentBlock.tsx
parent5afef5fe820674abfbdf58226ed0a6920b5c74f7 (diff)
downloaddexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.tar
dexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.tar.gz
dexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.tar.bz2
dexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.tar.lz
dexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.tar.xz
dexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.tar.zst
dexon-sol-tools-54bd7df900316504e4403bc94cffd92930a6c763.zip
fix linting + code syntax for statless components
Diffstat (limited to 'packages/dev-tools-pages/ts/components/ContentBlock.tsx')
-rw-r--r--packages/dev-tools-pages/ts/components/ContentBlock.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/dev-tools-pages/ts/components/ContentBlock.tsx b/packages/dev-tools-pages/ts/components/ContentBlock.tsx
index c54930902..66e0331ab 100644
--- a/packages/dev-tools-pages/ts/components/ContentBlock.tsx
+++ b/packages/dev-tools-pages/ts/components/ContentBlock.tsx
@@ -1,10 +1,11 @@
import * as React from 'react';
import styled from 'styled-components';
-import { withContext, Props } from './withContext';
-import { Beta, Alpha } from './Typography';
+import { ContextInterface } from 'ts/context';
import { media } from 'ts/variables';
+import { Alpha, Beta } from './Typography';
+
const Base = styled.div`
display: flex;
align-items: flex-start;
@@ -52,13 +53,13 @@ const StyledTitle = styled(Alpha)`
`};
`;
-interface ContentBlockProps extends Props {
+interface ContentBlockProps extends ContextInterface {
title: string;
main?: boolean;
children?: React.ReactNode;
}
-function ContentBlock(props: ContentBlockProps) {
+const ContentBlock: React.StatelessComponent<ContentBlockProps> = props => {
const children = React.Children.map(props.children, child => {
return <Item>{child}</Item>;
});
@@ -67,10 +68,10 @@ function ContentBlock(props: ContentBlockProps) {
return (
<Base>
- <Title color={props.colors.type}>{props.title}</Title>
+ <Title color={props.colors}>{props.title}</Title>
{children ? <Content>{children}</Content> : null}
</Base>
);
-}
+};
-export default withContext(ContentBlock);
+export { ContentBlock };