Skip to content

Commit

Permalink
Merge pull request #1 from IUBLibTech/no-footer
Browse files Browse the repository at this point in the history
Conditionally hide footer.
  • Loading branch information
cjcolvar authored Mar 19, 2019
2 parents 20fb65d + cc667f6 commit 87e0dd3
Show file tree
Hide file tree
Showing 4 changed files with 1,833 additions and 1,637 deletions.
8 changes: 6 additions & 2 deletions src/containers/Root/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import { Provider } from 'react-redux';
import VariationsMainView from '../VariationsMainView/VariationsMainView';
import { PersistGate } from 'redux-persist/integration/react';

const Root = ({ store, persistor, callback, hasResource }) => {
const Root = ({ store, persistor, callback, hasResource, noFooter }) => {
try {
return (
<Provider store={store}>
<PersistGate loading="loading..." persistor={persistor}>
<VariationsMainView callback={callback} hasResource={hasResource} />
<VariationsMainView
callback={callback}
hasResource={hasResource}
noFooter={noFooter}
/>
</PersistGate>
</Provider>
);
Expand Down
3 changes: 2 additions & 1 deletion src/containers/VariationsMainView/VariationsMainView.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class VariationsMainView extends React.Component {
selectedRanges,
hasResource,
colourPalette,
noFooter,
} = this.props;
return (
<div className="variations-app">
Expand Down Expand Up @@ -293,7 +294,7 @@ class VariationsMainView extends React.Component {
undoAll={this.props.canUndo ? this.props.undoAll : null}
swatch={this.props.colourPalette.colours}
/>
<Footer />
{!noFooter && <Footer />}
</div>
{(audioError.code || !isLoaded) && (
<ContentOverlay
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import Root from './containers/Root/Root';
import configureStore from './store/main';
import * as qs from 'query-string';

const { resource, save, callback, ...hash } = qs.parse(location.hash);
const { resource, save, callback, noFooter, ...hash } = qs.parse(location.hash);

// Set the hash back
location.hash = qs.stringify({ resource, save, callback, ...hash });
location.hash = qs.stringify({ resource, save, callback, noFooter, ...hash });

const { store, persistor } = configureStore(
resource,
Expand All @@ -22,6 +22,7 @@ render(
persistor={persistor}
callback={callback}
hasResource={!!resource}
noFooter={!!noFooter}
/>,
document.getElementById('app')
);
Loading

0 comments on commit 87e0dd3

Please sign in to comment.