Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally hide footer. #1

Merged
merged 1 commit into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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