mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
Render namespace as link in repo detail header
This commit is contained in:
@@ -33,6 +33,7 @@ import ErrorBoundary from "../ErrorBoundary";
|
||||
|
||||
type Props = {
|
||||
title?: string;
|
||||
titleComponent?: ReactNode;
|
||||
afterTitle?: ReactNode;
|
||||
subtitle?: string;
|
||||
loading?: boolean;
|
||||
@@ -90,7 +91,7 @@ export default class Page extends React.Component<Props> {
|
||||
}
|
||||
|
||||
renderPageHeader() {
|
||||
const { error, title, afterTitle, subtitle, children } = this.props;
|
||||
const { error, title, titleComponent, afterTitle, subtitle, children } = this.props;
|
||||
|
||||
let pageActions = null;
|
||||
let pageActionsExists = false;
|
||||
@@ -115,7 +116,7 @@ export default class Page extends React.Component<Props> {
|
||||
<div className="columns">
|
||||
<div className="column">
|
||||
<FlexContainer>
|
||||
<Title title={title} /> {afterTitle && <MarginLeft>{afterTitle}</MarginLeft>}
|
||||
<Title title={title}>{titleComponent}</Title>{afterTitle && <MarginLeft>{afterTitle}</MarginLeft>}
|
||||
</FlexContainer>
|
||||
<Subtitle subtitle={subtitle} />
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,7 @@ type Props = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, className }) => {
|
||||
const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle, className , children}) => {
|
||||
useEffect(() => {
|
||||
if (!preventRefreshingPageTitle) {
|
||||
if (customPageTitle) {
|
||||
@@ -42,7 +42,9 @@ const Title: FC<Props> = ({ title, preventRefreshingPageTitle, customPageTitle,
|
||||
}
|
||||
}, [title, preventRefreshingPageTitle, customPageTitle]);
|
||||
|
||||
if (title) {
|
||||
if (children) {
|
||||
return <h1 className={classNames("title", className)}>{children}</h1>;
|
||||
} else if (title) {
|
||||
return <h1 className={classNames("title", className)}>{title}</h1>;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user