45 lines
1.2 KiB
TypeScript
Raw Normal View History

import React from 'react';
import style from './PageTitle.module.css';
import GlobalInfos from '../../utils/GlobalInfos';
2020-12-29 19:39:30 +00:00
interface props {
title: string;
subtitle: string | null;
}
/**
* Component for generating PageTitle with bottom Line
*/
2020-12-29 19:39:30 +00:00
class PageTitle extends React.Component<props> {
render(): JSX.Element {
const themeStyle = GlobalInfos.getThemeStyle();
return (
2020-07-26 18:17:29 +02:00
<div className={style.pageheader + ' ' + themeStyle.backgroundcolor}>
<span className={style.pageheadertitle + ' ' + themeStyle.textcolor}>{this.props.title}</span>
<span className={style.pageheadersubtitle + ' ' + themeStyle.textcolor}>{this.props.subtitle}</span>
<>
{this.props.children}
</>
<Line/>
</div>
2020-07-26 18:17:29 +02:00
);
}
}
/**
* class to override default <hr> color and styling
* use this for horizontal lines to use the current active theming
*/
export class Line extends React.Component {
2020-12-29 19:39:30 +00:00
render(): JSX.Element {
const themeStyle = GlobalInfos.getThemeStyle();
return (
<>
<hr className={themeStyle.hrcolor}/>
</>
);
}
}
export default PageTitle;