Secondary header: add support for more than just text.

master
Tom Hacohen 6 years ago
parent 591549be2a
commit cf435118d4

@ -88,7 +88,7 @@ class Journal extends React.PureComponent<PropsTypeInner> {
return ( return (
<React.Fragment> <React.Fragment>
<SecondaryHeader text={collectionInfo.displayName} /> <SecondaryHeader>{collectionInfo.displayName}</SecondaryHeader>
<Tabs <Tabs
fullWidth={true} fullWidth={true}
style={{ backgroundColor: theme.palette.primary.main }} style={{ backgroundColor: theme.palette.primary.main }}

@ -2,7 +2,7 @@ import * as React from 'react';
import { Theme, withTheme } from '@material-ui/core/styles'; import { Theme, withTheme } from '@material-ui/core/styles';
export default withTheme()((props: {text: string, theme: Theme}) => { export default withTheme()((props: {children: React.ReactNode | React.ReactNode[], theme: Theme}) => {
const style = { const style = {
header: { header: {
backgroundColor: props.theme.palette.primary.main, backgroundColor: props.theme.palette.primary.main,
@ -17,7 +17,7 @@ export default withTheme()((props: {text: string, theme: Theme}) => {
return ( return (
<div style={style.header}> <div style={style.header}>
<h2 style={style.headerText}>{props.text}</h2> <h2 style={style.headerText}>{props.children}</h2>
</div> </div>
); );
}); });

Loading…
Cancel
Save