-
Notifications
You must be signed in to change notification settings - Fork 0
/
section.tsx
28 lines (24 loc) · 905 Bytes
/
section.tsx
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
import React from 'react'
interface SectionProps {
title: string;
background?: string;
children?: React.ReactNode;
}
export default function Section({ title, background, children }: SectionProps) {
const backgroundStyle = background && `url(${background}) center / cover no-repeat;`
return (
<section className="section section--gradient" style={{ background: backgroundStyle }}>
{background && <div className="section__bg" data-bg={background} style={{ background: backgroundStyle }} />}
<div className="container">
<div className="row">
<div className="col-12">
<h2 className="section__title">
{title}
</h2>
</div>
{children}
</div>
</div>
</section>
)
}