React-SaaS-sample/src/components/Section.js
Ruidy Nemausat d501c9d04f template
2019-11-02 20:18:05 +01:00

37 lines
725 B
JavaScript

import React from "react";
import BackgroundImage from "./BackgroundImage";
import "./Section.scss";
function Section(props) {
const {
color,
size,
backgroundImage,
backgroundImageOpacity,
children,
// Passed to section element
...otherProps
} = props;
return (
<section
className={
"SectionComponent hero section is-block is-relative" +
(color ? ` is-${color}` : "") +
(size ? ` is-${size}` : "")
}
{...otherProps}
>
{backgroundImage && (
<BackgroundImage
image={backgroundImage}
opacity={backgroundImageOpacity}
/>
)}
{props.children}
</section>
);
}
export default Section;