diff --git a/src/App.tsx b/src/App.tsx
index a5d11fe..dddb06f 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -23,7 +23,6 @@ import SideMenu from './SideMenu';
import LoginGate from './LoginGate';
import { RouteResolver } from './routes';
-import * as C from './constants';
import * as store from './store';
import * as actions from './store/actions';
@@ -41,6 +40,11 @@ const muiTheme = createMuiTheme({
}
});
+export let appBarPortals = {
+ 'title': null as Element | null,
+ 'buttons': null as Element | null,
+};
+
export const routeResolver = new RouteResolver({
home: '',
pim: {
@@ -127,11 +131,9 @@ const AppBarWitHistory = withRouter(
}
-
- {C.appName}
-
+
-
+
{iconElementRight}
diff --git a/src/Journal/index.tsx b/src/Journal/index.tsx
index 58c7ac3..7f028d0 100644
--- a/src/Journal/index.tsx
+++ b/src/Journal/index.tsx
@@ -8,10 +8,9 @@ import Contact from '../components/Contact';
import Calendar from '../components/Calendar';
import Event from '../components/Event';
+import AppBarOverride from '../widgets/AppBarOverride';
import Container from '../widgets/Container';
-import SecondaryHeader from '../components/SecondaryHeader';
-
import JournalEntries from '../components/JournalEntries';
import journalView from './journalView';
@@ -88,7 +87,7 @@ class Journal extends React.PureComponent
{
return (
- {collectionInfo.displayName}
+
{
(
-
+ <>
+
+
+ >
)}
/>
(
-
+ <>
+
+
+ >
)}
/>
{
- const style = {
- header: {
- backgroundColor: props.theme.palette.primary.main,
- color: props.theme.palette.primary.contrastText,
- padding: 15,
- textAlign: 'center' as any,
- },
- headerText: {
- margin: 0,
- },
- };
-
- return (
-
-
{props.children}
-
- );
-});
diff --git a/src/widgets/AppBarOverride.tsx b/src/widgets/AppBarOverride.tsx
new file mode 100644
index 0000000..d9735f2
--- /dev/null
+++ b/src/widgets/AppBarOverride.tsx
@@ -0,0 +1,20 @@
+import * as React from 'react';
+import * as ReactDOM from 'react-dom';
+
+export default (props: {title: string, children?: React.ReactNode | React.ReactNode[]}) => {
+ const titleEl = document.querySelector('#appbar-title');
+ const buttonsEl = document.querySelector('#appbar-buttons');
+
+ return (
+ <>
+ {titleEl && ReactDOM.createPortal(
+ {props.title},
+ titleEl
+ )}
+ {buttonsEl && props.children && ReactDOM.createPortal(
+ props.children,
+ buttonsEl
+ )}
+ >
+ );
+};