From d226f758396e064f568a79966a68b6ad19a97d2d Mon Sep 17 00:00:00 2001 From: David Zukowski Date: Fri, 8 Jan 2016 09:53:11 -0500 Subject: [PATCH] refactor(layouts): nest layout components in their own directory fix(views): cleanup broken imports fix(HomeView): cleanup broken imports --- src/layouts/{ => CoreLayout}/CoreLayout.js | 2 +- src/routes/index.js | 6 +++--- src/views/HomeView/HomeView.js | 2 +- tests/layouts/CoreLayout.spec.js | 3 ++- tests/views/HomeView.spec.js | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) rename src/layouts/{ => CoreLayout}/CoreLayout.js (95%) diff --git a/src/layouts/CoreLayout.js b/src/layouts/CoreLayout/CoreLayout.js similarity index 95% rename from src/layouts/CoreLayout.js rename to src/layouts/CoreLayout/CoreLayout.js index 149e4cb..3cada18 100644 --- a/src/layouts/CoreLayout.js +++ b/src/layouts/CoreLayout/CoreLayout.js @@ -1,5 +1,5 @@ import React from 'react' -import '../styles/core.scss' +import '../../styles/core.scss' // Note: Stateless/function components *will not* hot reload! // react-transform *only* works on component classes. diff --git a/src/routes/index.js b/src/routes/index.js index 26cf639..c762c73 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -6,9 +6,9 @@ import { Route, IndexRoute } from 'react-router' // they were from the root of the ~/src directory. This makes it // very easy to navigate to files regardless of how deeply nested // your current file is. -import CoreLayout from 'layouts/CoreLayout' -import HomeView from 'views/HomeView' -import AboutView from 'views/AboutView' +import CoreLayout from 'layouts/CoreLayout/CoreLayout' +import HomeView from 'views/HomeView/HomeView' +import AboutView from 'views/AboutView/AboutView' export default ( diff --git a/src/views/HomeView/HomeView.js b/src/views/HomeView/HomeView.js index 5d9d8ff..1c41aa5 100644 --- a/src/views/HomeView/HomeView.js +++ b/src/views/HomeView/HomeView.js @@ -1,7 +1,7 @@ import React from 'react' import { connect } from 'react-redux' import { Link } from 'react-router' -import { actions as counterActions } from '../redux/modules/counter' +import { actions as counterActions } from '../../redux/modules/counter' import styles from './HomeView.scss' // We define mapStateToProps where we'd normally use diff --git a/tests/layouts/CoreLayout.spec.js b/tests/layouts/CoreLayout.spec.js index 3d0de84..31bbc24 100644 --- a/tests/layouts/CoreLayout.spec.js +++ b/tests/layouts/CoreLayout.spec.js @@ -1,5 +1,6 @@ +import React from 'react' import TestUtils from 'react-addons-test-utils' -import CoreLayout from 'layouts/CoreLayout' +import CoreLayout from 'layouts/CoreLayout/CoreLayout' function shallowRender (component) { const renderer = TestUtils.createRenderer() diff --git a/tests/views/HomeView.spec.js b/tests/views/HomeView.spec.js index b4f622b..6c8845e 100644 --- a/tests/views/HomeView.spec.js +++ b/tests/views/HomeView.spec.js @@ -1,6 +1,7 @@ +import React from 'react' import TestUtils from 'react-addons-test-utils' import { bindActionCreators } from 'redux' -import { HomeView } from 'views/HomeView' +import { HomeView } from 'views/HomeView/HomeView' function shallowRender (component) { const renderer = TestUtils.createRenderer()