Work on event create/edit page

This commit is contained in:
Jan Tuomi
2020-02-22 19:59:06 +02:00
parent 1411685bbd
commit 37822aaaf8
7 changed files with 125 additions and 32 deletions
@@ -0,0 +1,34 @@
import * as React from "react";
import "./SectionDividerWidget.scss";
import Icon from "../Icon";
import { IconType } from "../Icon/Icon";
export interface SectionDividerWidgetProps {
label: string;
}
export interface SectionDividerWidgetState { }
const getIconByLabel = (label: string) => {
if (label === "Finnish") {
return <Icon name={IconType.FinlandFlag} />
}
if (label === "English") {
return <Icon name={IconType.GBFlag} />
}
console.error(`No icon found for label: ${label}`);
return null;
}
class SectionDividerWidget extends React.Component<SectionDividerWidgetProps, SectionDividerWidgetState> {
render() {
const { label } = this.props;
return (
<h3 className="section-divider-widget">
{label}&nbsp;{getIconByLabel(label)}
</h3>
);
}
}
export default SectionDividerWidget;