mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Extend PageHeader for plugins
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
This commit is contained in:
1 parent
498638c0c9
commit
51657bea44
1 file changed
+8
-2
@@ -1,13 +1,19 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { Space, Typography } from "antd";
|
||||||
|
const { Text } = Typography;
|
||||||
|
|
||||||
type PageHeaderProps = {
|
type PageHeaderProps = {
|
||||||
title: string|React.ReactElement;
|
title: string | React.ReactElement;
|
||||||
|
subTitle?: string | React.ReactElement;
|
||||||
extra?: React.JSX.Element;
|
extra?: React.JSX.Element;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function PageHeader(props: PageHeaderProps): React.JSX.Element {
|
export default function PageHeader(props: PageHeaderProps): React.JSX.Element {
|
||||||
return <div className="page-header">
|
return <div className="page-header">
|
||||||
<h2 className="page-header-title">{props.title}</h2>
|
<Space>
|
||||||
|
<h2 className="page-header-title">{props.title}</h2>
|
||||||
|
{props.subTitle && <Text type="secondary">{props.subTitle}</Text>}
|
||||||
|
</Space>
|
||||||
{props.extra && <div className="page-header-extra">{props.extra}</div>}
|
{props.extra && <div className="page-header-extra">{props.extra}</div>}
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user