Work on event create/edit page
This commit is contained in:
@@ -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} {getIconByLabel(label)}
|
||||
</h3>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SectionDividerWidget;
|
||||
Reference in New Issue
Block a user