chore(navigate): gatsby depricated navigateTo -> navigate

This commit is contained in:
Bouncey
2018-09-07 13:33:32 +01:00
committed by Stuart Taylor
parent c5c4f3aa41
commit 56494ffc32
4 changed files with 11 additions and 9 deletions

View File

@ -17,7 +17,7 @@ import Layout from '../components/Layout';
import { ButtonSpacer, Spacer } from '../components/helpers';
import { acceptTerms, userSelector } from '../redux';
import { createSelector } from 'reselect';
import { navigateTo } from 'gatsby';
import { navigate } from 'gatsby';
const propTypes = {
acceptTerms: PropTypes.func.isRequired,
@ -66,7 +66,7 @@ class AcceptPrivacyTerms extends Component {
render() {
const { acceptedPrivacyTerms } = this.props;
if (acceptedPrivacyTerms) {
navigateTo('/welcome');
navigate('/welcome');
return null;
}
const { privacyPolicy, termsOfService, quincyEmail } = this.state;

View File

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { navigateTo } from 'gatsby';
import { navigate } from 'gatsby';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
@ -52,13 +52,15 @@ function Welcome({
if (pending && !complete) {
return (
<Layout>
<Loader />
<div className='loader-wrapper'>
<Loader />
</div>
</Layout>
);
}
if (!acceptedPrivacyTerms) {
navigateTo('/accept-privacy-terms');
navigate('/accept-privacy-terms');
return null;
}

View File

@ -1,5 +1,5 @@
import { call, put, takeEvery } from 'redux-saga/effects';
import { navigateTo } from 'gatsby';
import { navigate } from 'gatsby';
import { acceptTermsComplete, acceptTermsError } from './';
import { createFlashMessage } from '../components/Flash/redux';
@ -18,7 +18,7 @@ function* acceptTermsSaga({ payload: quincyEmails }) {
}
function* acceptCompleteSaga() {
yield call(navigateTo, '/welcome');
yield call(navigate, '/welcome');
}
export function createAcceptTermsSaga(types) {

View File

@ -1,5 +1,5 @@
import { put, takeEvery, call } from 'redux-saga/effects';
import { navigateTo } from 'gatsby';
import { navigate } from 'gatsby';
import { createFlashMessage } from '../components/Flash/redux';
import { getShowCert } from '../utils/ajax';
@ -13,7 +13,7 @@ function* getShowCertSaga({ payload: { username, certName: cert } }) {
for (let i = 0; i < messages.length; i++) {
yield put(createFlashMessage(messages[i]));
}
yield call(navigateTo, '/');
yield call(navigate, '/');
return;
}
yield put(showCertComplete(response));