2018-03-01 15:40:36 +02:00
|
|
|
import React, { Fragment } from 'react';
|
2017-12-15 16:09:09 +02:00
|
|
|
import styled from 'styled-components';
|
2018-03-01 15:40:36 +02:00
|
|
|
import { Card, H2, P, H4 } from '../';
|
2017-12-15 16:09:09 +02:00
|
|
|
import remcalc from 'remcalc';
|
|
|
|
|
2018-03-21 18:19:17 +02:00
|
|
|
const CardStyled = styled(Card)`
|
2017-12-15 16:09:09 +02:00
|
|
|
margin-bottom: ${remcalc(36)};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Header = styled.header`
|
|
|
|
background: ${props => props.theme.primary};
|
|
|
|
padding: ${remcalc(50)} ${remcalc(120)};
|
|
|
|
position: relative;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Main = styled.div`
|
|
|
|
padding: ${remcalc(50)} ${remcalc(120)};
|
|
|
|
|
2018-02-26 14:07:30 +02:00
|
|
|
h4[class*='rsg--heading'] {
|
2017-12-15 16:09:09 +02:00
|
|
|
margin: 0;
|
|
|
|
line-height: ${remcalc(26)};
|
|
|
|
font-size: ${remcalc(21)};
|
|
|
|
|
|
|
|
& + p {
|
|
|
|
margin-top: ${remcalc(24)};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default allProps => {
|
2017-12-15 16:53:59 +02:00
|
|
|
const { name, content, components, sections, depth, description } = allProps;
|
2017-12-15 16:09:09 +02:00
|
|
|
|
2018-03-01 15:40:36 +02:00
|
|
|
if (depth === 1) {
|
|
|
|
return (
|
2018-03-23 19:46:42 +02:00
|
|
|
<CardStyled>
|
2018-03-01 15:40:36 +02:00
|
|
|
<Header>
|
|
|
|
<H2 white>{name}</H2>
|
2018-03-21 18:19:17 +02:00
|
|
|
{description ? <P white>{description}</P> : null}
|
2018-03-01 15:40:36 +02:00
|
|
|
</Header>
|
|
|
|
<Main>
|
|
|
|
{content}
|
|
|
|
{components}
|
|
|
|
{sections}
|
|
|
|
</Main>
|
|
|
|
</CardStyled>
|
2018-03-21 18:19:17 +02:00
|
|
|
);
|
2018-03-01 15:40:36 +02:00
|
|
|
}
|
|
|
|
|
2017-12-15 16:09:09 +02:00
|
|
|
return (
|
2018-03-01 15:40:36 +02:00
|
|
|
<Fragment>
|
|
|
|
<header>
|
|
|
|
<H4 white>{name}</H4>
|
|
|
|
{description ? <P white>{description}</P> : null}
|
|
|
|
</header>
|
|
|
|
<div>
|
2017-12-15 16:09:09 +02:00
|
|
|
{content}
|
|
|
|
{components}
|
|
|
|
{sections}
|
2018-03-01 15:40:36 +02:00
|
|
|
</div>
|
|
|
|
</Fragment>
|
2018-03-21 18:19:17 +02:00
|
|
|
);
|
2017-12-15 16:09:09 +02:00
|
|
|
};
|