lemmy-ui/src/shared/components/common/banner-icon-header.tsx

34 lines
793 B
TypeScript
Raw Normal View History

2021-02-22 02:39:04 +00:00
import { Component } from "inferno";
import { PictrsImage } from "./pictrs-image";
interface BannerIconHeaderProps {
banner?: string;
icon?: string;
}
export class BannerIconHeader extends Component<BannerIconHeaderProps, any> {
constructor(props: any, context: any) {
super(props, context);
}
render() {
2023-06-05 21:31:12 +00:00
const banner = this.props.banner;
const icon = this.props.icon;
2023-06-17 19:32:29 +00:00
return (
(banner || icon) && (
2023-06-20 18:46:16 +00:00
<div className="banner-icon-header position-relative mb-2">
2023-06-17 19:32:29 +00:00
{banner && <PictrsImage src={banner} banner alt="" />}
{icon && (
<PictrsImage
src={icon}
iconOverlay
pushup={!!this.props.banner}
alt=""
/>
)}
</div>
)
);
}
}