new PageTitle component to have each page the same title

This commit is contained in:
2020-06-19 00:16:18 +02:00
parent 63284da11e
commit d034b2bc52
8 changed files with 60 additions and 29 deletions

View File

@ -0,0 +1,17 @@
.pageheader {
margin-top: 20px;
margin-bottom: 20px;
padding-left: 22%;
padding-right: 12%;
}
.pageheadertitle {
font-size: 40pt;
font-weight: bold;
}
.pageheadersubtitle {
margin-left: 20px;
font-size: 23pt;
opacity: 0.6;
}

View File

@ -0,0 +1,24 @@
import React from "react";
import "./PageTitle.css"
class PageTitle extends React.Component {
constructor(props) {
super(props);
this.props = props;
}
render() {
return (
<div className='pageheader'>
<span className='pageheadertitle'>{this.props.title}</span>
<span className='pageheadersubtitle'>{this.props.subtitle}</span>
{this.props.children}
<hr/>
</div>
);
}
}
export default PageTitle;

View File

@ -0,0 +1,12 @@
import React from 'react';
import {shallow} from 'enzyme'
import PageTitle from "./PageTitle";
describe('<Preview/>', function () {
it('renders without crashing ', function () {
const wrapper = shallow(<PageTitle/>);
wrapper.unmount();
});
});