mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Add className option for Title component, add administration title
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import React from "react";
|
||||
import classNames from "classnames";
|
||||
|
||||
type Props = {
|
||||
subtitle?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
class Subtitle extends React.Component<Props> {
|
||||
render() {
|
||||
const { subtitle } = this.props;
|
||||
const { subtitle, className } = this.props;
|
||||
if (subtitle) {
|
||||
return <h2 className="subtitle">{subtitle}</h2>;
|
||||
return <h2 className={classNames("subtitle", className)}>{subtitle}</h2>;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import React, { FC, useEffect } from "react";
|
||||
import classNames from "classnames";
|
||||
|
||||
type Props = {
|
||||
title?: string;
|
||||
customPageTitle?: string;
|
||||
preventRefreshingPageTitle?: boolean;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle }) => {
|
||||
const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, className }) => {
|
||||
useEffect(() => {
|
||||
if (!preventRefreshingPageTitle) {
|
||||
if (customPageTitle) {
|
||||
@@ -18,7 +20,7 @@ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle }
|
||||
});
|
||||
|
||||
if (title) {
|
||||
return <h1 className="title">{title}</h1>;
|
||||
return <h1 className={classNames("title", className)}>{title}</h1>;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user