2022-06-21 21:42:29 +00:00
|
|
|
import { Option } from "@sniptt/monads";
|
2021-02-22 02:39:04 +00:00
|
|
|
import { Component } from "inferno";
|
|
|
|
import { PictrsImage } from "./pictrs-image";
|
2020-09-06 16:15:25 +00:00
|
|
|
|
|
|
|
interface BannerIconHeaderProps {
|
2022-06-21 21:42:29 +00:00
|
|
|
banner: Option<string>;
|
|
|
|
icon: Option<string>;
|
2020-09-06 16:15:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class BannerIconHeader extends Component<BannerIconHeaderProps, any> {
|
|
|
|
constructor(props: any, context: any) {
|
|
|
|
super(props, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div class="position-relative mb-2">
|
2022-06-21 21:42:29 +00:00
|
|
|
{this.props.banner.match({
|
|
|
|
some: banner => <PictrsImage src={banner} banner alt="" />,
|
|
|
|
none: <></>,
|
|
|
|
})}
|
|
|
|
{this.props.icon.match({
|
|
|
|
some: icon => (
|
|
|
|
<PictrsImage
|
|
|
|
src={icon}
|
|
|
|
iconOverlay
|
|
|
|
pushup={this.props.banner.isSome()}
|
|
|
|
alt=""
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
none: <></>,
|
|
|
|
})}
|
2020-09-06 16:15:25 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|