-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathColumns.tsx
More file actions
69 lines (63 loc) · 1.73 KB
/
Columns.tsx
File metadata and controls
69 lines (63 loc) · 1.73 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import React from 'react'
import styled from 'styled-components'
import PropTypes from 'prop-types'
import useDocumentTitle from 'src/hooks/useDocumentTitle'
import { SCREEN } from 'src/styles/theme'
import Footer from 'src/components/Footer/Footer'
import BaseLang from 'src/components/Lang/Lang'
const Lang = styled(BaseLang)`
position: absolute;
right: 20px;
top: 10px;
z-index: 1;
`
const Wrapper = styled.div`
display: flex;
position: relative;
flex-direction: column;
${SCREEN.DESKTOP} {
flex-direction: row;
}
`
const Left = styled.div`
padding: ${({ theme }) => `4rem ${theme.spacing.L} ${theme.spacing.L}`};
width: 100%;
background: ${({ theme }) => theme.color.white};
${SCREEN.DESKTOP} {
padding: ${({ theme }) =>
`${theme.spacing.XXXL} ${theme.spacing.M} ${theme.spacing.XXXL} ${theme.spacing.M}`};
width: 55%;
}
`
const Right = styled.div`
display: flex;
position: relative;
flex-direction: column;
justify-content: center;
background: ${({ theme }) => theme.color.grey};
width: 100%;
padding: ${({ theme }) => theme.spacing.M};
${SCREEN.DESKTOP} {
width: 45%;
padding: 7rem 6.5rem;
}
`
export default function Columns({ children, title }) {
useDocumentTitle(title)
const [first, ...second] = React.Children.toArray(children)
return (
<>
<Wrapper>
<Lang />
<Left>{first}</Left>
<Right>{second}</Right>
</Wrapper>
<Footer />
</>
)
}
Columns.propTypes = {
children: PropTypes.oneOfType([PropTypes.node, PropTypes.element])
.isRequired,
title: PropTypes.string.isRequired,
}