34 lines
747 B
TypeScript
34 lines
747 B
TypeScript
import * as React from "react";
|
|
import "./PageSection.scss";
|
|
|
|
export enum BackgroundColor {
|
|
DarkBlue,
|
|
White,
|
|
Orange,
|
|
}
|
|
|
|
export interface PageSectionProps {
|
|
backgroundColor: BackgroundColor;
|
|
}
|
|
export interface PageSectionState {}
|
|
|
|
const colors = new Map<BackgroundColor, string>([
|
|
[BackgroundColor.DarkBlue, "dark-blue"],
|
|
[BackgroundColor.White, "white"],
|
|
[BackgroundColor.Orange, "orange"],
|
|
]);
|
|
|
|
class PageSection extends React.Component<PageSectionProps, PageSectionState> {
|
|
render() {
|
|
const { backgroundColor, children } = this.props;
|
|
const className = `page-section ${colors.get(backgroundColor)}`;
|
|
return (
|
|
<div className={className}>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default PageSection;
|