diff options
author | August Skare <post@augustskare.no> | 2018-11-20 00:27:00 +0800 |
---|---|---|
committer | August Skare <post@augustskare.no> | 2018-11-20 00:27:00 +0800 |
commit | 31d07fdac80a2a546646b1eb232fa7dd6319ce83 (patch) | |
tree | cd2bbb781ea499f599c6b06d54270067c437c020 /packages/dev-tools-pages/ts/components/content-block.tsx | |
parent | 881655bb57e93fa1cf344585cda1653c995f1411 (diff) | |
download | dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.tar dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.tar.gz dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.tar.bz2 dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.tar.lz dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.tar.xz dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.tar.zst dexon-sol-tools-31d07fdac80a2a546646b1eb232fa7dd6319ce83.zip |
rename all files and directories to lowercase
Diffstat (limited to 'packages/dev-tools-pages/ts/components/content-block.tsx')
-rw-r--r-- | packages/dev-tools-pages/ts/components/content-block.tsx | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/packages/dev-tools-pages/ts/components/content-block.tsx b/packages/dev-tools-pages/ts/components/content-block.tsx new file mode 100644 index 000000000..2818858dc --- /dev/null +++ b/packages/dev-tools-pages/ts/components/content-block.tsx @@ -0,0 +1,77 @@ +import * as React from 'react'; +import styled from 'styled-components'; + +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; + justify-content: space-between; + :not(:last-of-type) { + margin-bottom: 6.25rem; + } + ${Beta} { + margin-bottom: 2.5rem; + } + ${media.small` + display: block; + :not(:last-of-type) { + margin-bottom: 3.125rem; + } + `}; +`; + +const Content = styled.div` + width: 66.693548387%; + ${media.small` + width: 100%; + `}; +`; + +const Item = styled.div` + p { + max-width: 31.25rem; + } + + &:not(:last-of-type) { + margin-bottom: 2.5rem; + ${media.small` + margin-bottom: 1.875rem; + `}; + } +`; + +const StyledTitle = styled(Alpha)` + color: ${props => props.color}; + ${media.small` + & + div { + margin-top: 1.5rem; + } + `}; +`; + +interface ContentBlockProps extends ContextInterface { + title: string; + main?: boolean; + children?: React.ReactNode; +} + +const ContentBlock: React.StatelessComponent<ContentBlockProps> = props => { + const children = React.Children.map(props.children, child => { + return <Item>{child}</Item>; + }); + + const Title = props.main ? StyledTitle : Beta; + + return ( + <Base> + <Title color={props.colors}>{props.title}</Title> + {children === undefined ? null : <Content>{children}</Content>} + </Base> + ); +}; + +export { ContentBlock }; |