You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
624 B
TypeScript
25 lines
624 B
TypeScript
7 years ago
|
import * as React from 'react';
|
||
|
|
||
7 years ago
|
import { getPalette } from '../App';
|
||
7 years ago
|
|
||
7 years ago
|
export default (props: {text: string, backgroundColor?: string, children?: any}) => {
|
||
7 years ago
|
const style = {
|
||
|
header: {
|
||
7 years ago
|
backgroundColor: (props.backgroundColor !== undefined) ? props.backgroundColor : getPalette('accent1Color'),
|
||
7 years ago
|
color: getPalette('alternateTextColor'),
|
||
|
padding: 15,
|
||
|
},
|
||
|
headerText: {
|
||
|
marginTop: 10,
|
||
|
marginBottom: 10,
|
||
|
},
|
||
|
};
|
||
|
|
||
|
return (
|
||
|
<div style={style.header}>
|
||
|
<h2 style={style.headerText}>{props.text}</h2>
|
||
|
{props.children}
|
||
|
</div>
|
||
|
);
|
||
|
};
|