remove contentBlock from content component

This commit is contained in:
August Skare
2018-10-22 13:24:43 +02:00
parent 8cf720986e
commit 00afb2440d
6 changed files with 15 additions and 17 deletions

View File

@@ -21,8 +21,6 @@ const StyledMain =
`;
interface MainProps {
title?: string;
subtitle?: string;
dark?: boolean;
children: React.ReactNode;
}
@@ -30,13 +28,7 @@ interface MainProps {
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>
<Container>{props.children}</Container>
</StyledMain>
);
}

View File

@@ -29,13 +29,12 @@ const Item = styled.div`
const StyledTitle = styled(Alpha)`
color: ${props => props.color};
margin-bottom: 6.25rem;
`;
interface ContentBlockProps extends Props {
title: string;
main?: boolean;
children: React.ReactNode;
children?: React.ReactNode;
}
function ContentBlock(props: ContentBlockProps) {
@@ -48,7 +47,7 @@ function ContentBlock(props: ContentBlockProps) {
return (
<Base>
<Title color={props.colors.main}>{props.title}</Title>
<Content>{children}</Content>
{children ? <Content>{children}</Content> : null}
</Base>
);
}

View File

@@ -16,6 +16,7 @@ function Compiler() {
<Base context={context}>
<CompilerComponent />
<Content>
<ContentBlock main title="Get started" />
<ContentBlock title="Required steps">
<List items={['Step 1', 'Step 2']} />
</ContentBlock>
@@ -45,11 +46,14 @@ const artifactAdapter = new SolCompilerArtifactAdapter(artifactsDir, contractsDi
</Tabs>
</ContentBlock>
</Content>
<Content
title="Artifacts"
subtitle="Sol compiler uses solidity standard JSON output format for the artifacts. This way, you can define which parts of the artifact you need."
dark
>
<Content dark>
<ContentBlock main title="Artifacts">
<p>
Sol compiler uses solidity standard JSON output format for the artifacts. This way, you can
define which parts of the artifact you need.
</p>
</ContentBlock>
<ContentBlock title="Production">
<p>
Sol compiler uses solidity standard JSON output format for the artifacts. This way, you can

View File

@@ -22,6 +22,7 @@ function Cov() {
</p>
</Intro>
<Content>
<ContentBlock main title="Get started" />
<ContentBlock title="Required steps">
<List items={['Step 1', 'Step 2']} />
</ContentBlock>

View File

@@ -22,6 +22,7 @@ function Profiler() {
</p>
</Intro>
<Content>
<ContentBlock main title="Get started" />
<ContentBlock title="Required steps">
<List items={['Step 1', 'Step 2']} />
</ContentBlock>

View File

@@ -16,6 +16,7 @@ function Trace() {
<Base context={context}>
<TraceComponent />
<Content>
<ContentBlock main title="Get started" />
<ContentBlock title="Required steps">
<List items={['Step 1', 'Step 2']} />
</ContentBlock>