new PageTitle component to have each page the same title
This commit is contained in:
17
src/elements/PageTitle/PageTitle.css
Normal file
17
src/elements/PageTitle/PageTitle.css
Normal 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;
|
||||
}
|
24
src/elements/PageTitle/PageTitle.js
Normal file
24
src/elements/PageTitle/PageTitle.js
Normal 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;
|
12
src/elements/PageTitle/PageTitle.test.js
Normal file
12
src/elements/PageTitle/PageTitle.test.js
Normal 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();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user