move favorite icon from details table to page title

This commit is contained in:
Eduard Heimbuch
2020-03-25 08:08:40 +01:00
parent e2d4ebe706
commit df285182a8
3 changed files with 14 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import ErrorBoundary from "../ErrorBoundary";
type Props = {
title?: string;
afterTitle?: ReactNode;
subtitle?: string;
loading?: boolean;
error?: Error;
@@ -27,6 +28,10 @@ const PageActionContainer = styled.div`
}
`;
const MarginLeft = styled.div`
margin-left: 0.5rem;
`;
export default class Page extends React.Component<Props> {
componentDidUpdate() {
const { title } = this.props;
@@ -57,7 +62,7 @@ export default class Page extends React.Component<Props> {
}
renderPageHeader() {
const { error, title, subtitle, children } = this.props;
const { error, title, afterTitle, subtitle, children } = this.props;
let pageActions = null;
let pageActionsExists = false;
@@ -81,7 +86,9 @@ export default class Page extends React.Component<Props> {
<>
<div className="columns">
<div className="column">
<Title title={title} />
<div className="is-flex">
<Title title={title} /> <MarginLeft>{afterTitle}</MarginLeft>
</div>
<Subtitle subtitle={subtitle} />
</div>
{pageActions}