From 91f22947818e722e4fc8e30eaef2942f77e9c23b Mon Sep 17 00:00:00 2001
From: Frank Sauerburger <frank@sauerburger.com>
Date: Sun, 24 Mar 2019 12:54:07 +0100
Subject: [PATCH] Clean up Redux skeleton

---
 app/actions/actionTypes.js |  0
 app/actions/index.js       |  0
 app/assets/index.html      |  8 ++------
 app/components/App.jsx     |  8 +-------
 app/components/Counter.jsx | 29 -----------------------------
 app/initialize.jsx         | 21 ++++-----------------
 app/reducers.js            | 10 ----------
 app/reducers/index.js      |  0
 app/styles/application.css | 20 --------------------
 9 files changed, 7 insertions(+), 89 deletions(-)
 create mode 100644 app/actions/actionTypes.js
 create mode 100644 app/actions/index.js
 delete mode 100644 app/components/Counter.jsx
 delete mode 100644 app/reducers.js
 create mode 100644 app/reducers/index.js

diff --git a/app/actions/actionTypes.js b/app/actions/actionTypes.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/actions/index.js b/app/actions/index.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/assets/index.html b/app/assets/index.html
index 6b8cac7..d5bf87a 100644
--- a/app/assets/index.html
+++ b/app/assets/index.html
@@ -2,15 +2,11 @@
 <head>
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width" />
-  <title>Brunch</title>
+  <title>Long Route</title>
   <link rel="stylesheet" href="/app.css" />
   <script src="/app.js"></script>
   <script>require('initialize');</script>
 </head>
 <body>
-  <div class="brunch">
-    <a href="http://brunch.io"><img src="http://brunch.io/images/logo.png" alt="Brunch"></a>
-    <p>Bon Appétit.</p>
-    <div id="app"></div>
-  </div>
+  <div id="app"></div>
 </body>
diff --git a/app/components/App.jsx b/app/components/App.jsx
index 2ca0c1a..7946671 100644
--- a/app/components/App.jsx
+++ b/app/components/App.jsx
@@ -1,13 +1,7 @@
 import React from 'react';
-import Counter from './Counter';
 
 export default class App extends React.Component {
   render() {
-    const widget = (
-      <div id="content">
-        <Counter />
-      </div>
-    );
-    return widget;
+    return (<p>Hello</p>)
   }
 }
diff --git a/app/components/Counter.jsx b/app/components/Counter.jsx
deleted file mode 100644
index cc011ee..0000000
--- a/app/components/Counter.jsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { connect } from 'react-redux';
-
-const BaseCounter = ({ count, onPlusClick, onMinusClick }) => (
-  <div>
-    <h5><a href="https://redux.js.org/">Redux</a> &amp; <a href="https://facebook.github.io/react/">React</a> Counter</h5>
-    <p>
-      <button onClick={onMinusClick}>-</button>
-      {count}
-      <button onClick={onPlusClick}>+</button>
-    </p>
-  </div>
-);
-
-BaseCounter.propTypes = {
-  count: PropTypes.number.isRequired,
-  onPlusClick: PropTypes.func.isRequired,
-  onMinusClick: PropTypes.func.isRequired,
-};
-
-const mapStateToProps = state => ({ count: state });
-
-const mapDispatchToProps = dispatch => ({
-  onPlusClick: () => dispatch({ type: 'INCREMENT' }),
-  onMinusClick: () => dispatch({ type: 'DECREMENT' }),
-});
-
-export default connect(mapStateToProps, mapDispatchToProps)(BaseCounter);
diff --git a/app/initialize.jsx b/app/initialize.jsx
index 4b0dd45..63fa3e5 100644
--- a/app/initialize.jsx
+++ b/app/initialize.jsx
@@ -2,29 +2,16 @@ import ReactDOM from 'react-dom';
 import React from 'react';
 import { Provider } from 'react-redux';
 import { createStore } from 'redux';
-import counterApp from './reducers';
 import App from './components/App';
 
-const store = createStore(counterApp, module.hot && module.hot.data && (module.hot.data.counter || 0));
-
-if (module.hot) {
-  module.hot.accept('./reducers', () => {
-    store.replaceReducer(require('./reducers').default); // eslint-disable-line
-  });
-  module.hot.accept();
-
-  module.hot.dispose((data) => {
-    data.counter = store.getState(); // eslint-disable-line
-    [].slice.apply(document.querySelector('#app').children).forEach(c => c.remove());
-  });
-}
+// const store = createStore(counterApp, module.hot && module.hot.data && (module.hot.data.counter || 0));
 
 const load = () => {
   ReactDOM.render(
-    <Provider store={store}>
+    //<Provider store={store}>
       <App />
-    </Provider>,
-    document.querySelector('#app')
+    //</Provider>
+    , document.querySelector('#app')
   );
 };
 
diff --git a/app/reducers.js b/app/reducers.js
deleted file mode 100644
index 410cfb9..0000000
--- a/app/reducers.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default (state = 0, action) => {
-  switch (action.type) {
-    case 'INCREMENT':
-      return state + 1;
-    case 'DECREMENT':
-      return state - 1;
-    default:
-      return state;
-  }
-};
diff --git a/app/reducers/index.js b/app/reducers/index.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/styles/application.css b/app/styles/application.css
index efa58d9..e69de29 100644
--- a/app/styles/application.css
+++ b/app/styles/application.css
@@ -1,20 +0,0 @@
-.brunch {
-  font-family: -apple-system, Sans-Serif;
-  text-align: center;
-  font-size: 24pt;
-  color: #3f894a;
-}
-
-a {
-  color: #3f894a;
-  text-decoration: none;
-  border-bottom: 1px solid rgba(0, 0, 0, 0);
-}
-
-a:hover {
-  color: #27552e;
-}
-
-h5 > a {
-  text-decoration: underline;
-}
-- 
GitLab