aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/Main.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/dev-tools-pages/ts/components/Main.tsx')
-rw-r--r--packages/dev-tools-pages/ts/components/Main.tsx43
1 files changed, 27 insertions, 16 deletions
diff --git a/packages/dev-tools-pages/ts/components/Main.tsx b/packages/dev-tools-pages/ts/components/Main.tsx
index 8046abc91..6c0270dbc 100644
--- a/packages/dev-tools-pages/ts/components/Main.tsx
+++ b/packages/dev-tools-pages/ts/components/Main.tsx
@@ -1,33 +1,44 @@
import * as React from 'react';
import styled from 'styled-components';
-import { withContext, Props } from './withContext';
+import { Beta } from './Typography';
+import Container from './Container';
+import ContentBlock from './ContentBlock';
-import { Alpha } from './Typography';
-
-const StyledMain = styled.div`
+const StyledMain =
+ styled.div <
+ MainProps >
+ `
padding-top: 6.25rem;
padding-bottom: 6.25rem;
+ ${props =>
+ props.dark
+ ? `
+ background-color: #000;
+ color: #fff;
+ `
+ : ''};
`;
-const Title = styled(Alpha)`
- color: ${props => props.color};
- margin-bottom: 6.25rem;
-`;
-
-interface MainProps extends Props {
+interface MainProps {
+ title?: string;
+ subtitle?: string;
+ dark?: boolean;
children: React.ReactNode;
}
function Main(props: MainProps) {
return (
- <StyledMain>
- <Title as="h2" color={props.colors.main}>
- Get started
- </Title>
- {props.children}
+ <StyledMain dark={props.dark}>
+ <Container>
+ <ContentBlock main title={props.title || 'Get started'}>
+ {props.subtitle ? <Beta as="p">{props.subtitle}</Beta> : null}
+ </ContentBlock>
+
+ {props.children}
+ </Container>
</StyledMain>
);
}
-export default withContext(Main);
+export default Main;