From 0ca26678f8ca6ba0194677bbc6610685d4e3d04e Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 4 Sep 2017 15:33:47 +0200 Subject: [PATCH] EditListingPage renamed to ProfileSettingsPage --- src/app.test.js | 2 +- .../ProfileSettingsPage.js} | 18 ++++++++---------- .../ProfileSettingsPage.test.js} | 4 ++-- .../ProfileSettingsPage.test.js.snap} | 2 +- src/containers/index.js | 4 ++-- src/routesConfiguration.js | 18 ++++++++---------- 6 files changed, 22 insertions(+), 26 deletions(-) rename src/containers/{EditProfilePage/EditProfilePage.js => ProfileSettingsPage/ProfileSettingsPage.js} (83%) rename src/containers/{EditProfilePage/EditProfilePage.test.js => ProfileSettingsPage/ProfileSettingsPage.test.js} (84%) rename src/containers/{EditProfilePage/__snapshots__/EditProfilePage.test.js.snap => ProfileSettingsPage/__snapshots__/ProfileSettingsPage.test.js.snap} (90%) diff --git a/src/app.test.js b/src/app.test.js index ee59940a..d86efbe9 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -67,7 +67,7 @@ describe('Application', () => { '/l/new': defaultAuthPath, '/l/listing-title-slug/1234/new/description': defaultAuthPath, '/l/listing-title-slug/1234/checkout': defaultAuthPath, - '/u/1234/edit': defaultAuthPath, + '/profile-settings': defaultAuthPath, '/inbox': defaultAuthPath, '/inbox/orders': defaultAuthPath, '/inbox/sales': defaultAuthPath, diff --git a/src/containers/EditProfilePage/EditProfilePage.js b/src/containers/ProfileSettingsPage/ProfileSettingsPage.js similarity index 83% rename from src/containers/EditProfilePage/EditProfilePage.js rename to src/containers/ProfileSettingsPage/ProfileSettingsPage.js index a44c6e6b..f736e7d8 100644 --- a/src/containers/EditProfilePage/EditProfilePage.js +++ b/src/containers/ProfileSettingsPage/ProfileSettingsPage.js @@ -7,7 +7,7 @@ import { logout, authenticationInProgress } from '../../ducks/Auth.duck'; import { manageDisableScrolling, isScrollingDisabled } from '../../ducks/UI.duck'; import { PageLayout, Topbar } from '../../components'; -export const EditProfilePageComponent = props => { +export const ProfileSettingsPageComponent = props => { const { authInfoError, authInProgress, @@ -20,14 +20,13 @@ export const EditProfilePageComponent = props => { notificationCount, onLogout, onManageDisableScrolling, - params, } = props; return ( { ); }; -EditProfilePageComponent.defaultProps = { +ProfileSettingsPageComponent.defaultProps = { authInfoError: null, currentUser: null, logoutError: null, notificationCount: 0, }; -const { bool, func, instanceOf, number, object, shape, string } = PropTypes; +const { bool, func, instanceOf, number, object, shape } = PropTypes; -EditProfilePageComponent.propTypes = { +ProfileSettingsPageComponent.propTypes = { authInfoError: instanceOf(Error), authInProgress: bool.isRequired, currentUser: propTypes.currentUser, @@ -63,7 +62,6 @@ EditProfilePageComponent.propTypes = { notificationCount: number, onLogout: func.isRequired, onManageDisableScrolling: func.isRequired, - params: shape({ displayName: string.isRequired }).isRequired, // from withRouter history: shape({ @@ -99,8 +97,8 @@ const mapDispatchToProps = dispatch => ({ dispatch(manageDisableScrolling(componentId, disableScrolling)), }); -const EditProfilePage = compose(connect(mapStateToProps, mapDispatchToProps), withRouter)( - EditProfilePageComponent +const ProfileSettingsPage = compose(connect(mapStateToProps, mapDispatchToProps), withRouter)( + ProfileSettingsPageComponent ); -export default EditProfilePage; +export default ProfileSettingsPage; diff --git a/src/containers/EditProfilePage/EditProfilePage.test.js b/src/containers/ProfileSettingsPage/ProfileSettingsPage.test.js similarity index 84% rename from src/containers/EditProfilePage/EditProfilePage.test.js rename to src/containers/ProfileSettingsPage/ProfileSettingsPage.test.js index cca70454..d9ef3ce0 100644 --- a/src/containers/EditProfilePage/EditProfilePage.test.js +++ b/src/containers/ProfileSettingsPage/ProfileSettingsPage.test.js @@ -1,13 +1,13 @@ import React from 'react'; import { renderShallow } from '../../util/test-helpers'; -import { EditProfilePageComponent } from './EditProfilePage'; +import { ProfileSettingsPageComponent } from './ProfileSettingsPage'; const noop = () => null; describe('ContactDetailsPage', () => { it('matches snapshot', () => { const tree = renderShallow( - + title="Profile settings"> , - routes: [ - { - path: '/u/:displayName/edit', - auth: true, - exact: true, - name: 'EditProfilePage', - component: props => , - }, - ], }, ], }, + { + path: '/profile-settings', + auth: true, + exact: true, + name: 'ProfileSettingsPage', + component: props => , + }, { path: '/login', exact: true,