support dark alternative of Main component
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Beta } from './Typography';
|
||||
import { withContext, Props } from './withContext';
|
||||
import { Beta, Alpha } from './Typography';
|
||||
|
||||
const Base = styled.div`
|
||||
display: flex;
|
||||
@@ -26,8 +27,14 @@ const Item = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
interface ContentBlockProps {
|
||||
const StyledTitle = styled(Alpha)`
|
||||
color: ${props => props.color};
|
||||
margin-bottom: 6.25rem;
|
||||
`;
|
||||
|
||||
interface ContentBlockProps extends Props {
|
||||
title: string;
|
||||
main?: boolean;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
@@ -36,12 +43,14 @@ function ContentBlock(props: ContentBlockProps) {
|
||||
return <Item>{child}</Item>;
|
||||
});
|
||||
|
||||
const Title = props.main ? StyledTitle : Beta;
|
||||
|
||||
return (
|
||||
<Base>
|
||||
<Beta>{props.title}</Beta>
|
||||
<Title color={props.colors.main}>{props.title}</Title>
|
||||
<Content>{children}</Content>
|
||||
</Base>
|
||||
);
|
||||
}
|
||||
|
||||
export default ContentBlock;
|
||||
export default withContext(ContentBlock);
|
||||
|
Reference in New Issue
Block a user