aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-tools-pages/ts/components/Main.tsx
blob: 6c0270dbc6a48479c5016ef4a8bed53d4b5161ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as React from 'react';
import styled from 'styled-components';

import { Beta } from './Typography';
import Container from './Container';
import ContentBlock from './ContentBlock';

const StyledMain =
    styled.div <
    MainProps >
    `
    padding-top: 6.25rem;
    padding-bottom: 6.25rem;
    ${props =>
        props.dark
            ? `
        background-color: #000;
        color: #fff;
    `
            : ''};
`;

interface MainProps {
    title?: string;
    subtitle?: string;
    dark?: boolean;
    children: React.ReactNode;
}

function Main(props: MainProps) {
    return (
        <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 Main;