Skip to content

Commit

Permalink
Extend PageHeader for plugins
Browse files Browse the repository at this point in the history
My plugins used the antd pageheader more than base did. I did not notice that these features dissappeared when we migrated from antd to our own implementation - this brings them back
  • Loading branch information
Danielv123 committed Jun 8, 2024
1 parent 2c2521a commit a060da7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/web_ui/src/components/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import React from "react";
import { Typography } from "antd";
const { Text } = Typography;

type PageHeaderProps = {
title: string|React.ReactElement;
title: string | React.ReactElement;
subTitle?: string | React.ReactElement;
footer?: React.JSX.Element;
extra?: React.JSX.Element;
};

export default function PageHeader(props: PageHeaderProps): React.JSX.Element {
return <div className="page-header">
<h2 className="page-header-title">{props.title}</h2>
{props.subTitle && <Text type="secondary">{props.subTitle}</Text>}
{props.footer && props.footer}
{props.extra && <div className="page-header-extra">{props.extra}</div>}
</div>;
}

0 comments on commit a060da7

Please sign in to comment.