From bf85e5a8d6892128b04ca2f4f6b688e302c5fb89 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Sat, 3 Feb 2018 12:57:04 +0100 Subject: [PATCH] more setup --- package.json | 2 +- src/App.css | 28 ------------------------ src/components/App.js | 16 +++++--------- src/components/Feed.js | 5 +++++ src/index.css | 5 ----- src/index.js | 49 ++++++++++++++++++++++++++---------------- src/logo.svg | 7 ------ yarn.lock | 10 ++++++--- 8 files changed, 48 insertions(+), 74 deletions(-) delete mode 100644 src/App.css create mode 100644 src/components/Feed.js delete mode 100644 src/index.css delete mode 100644 src/logo.svg diff --git a/package.json b/package.json index db807da..eb659d7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "react-hot-loader": "^3.1.3", "react-redux": "^5.0.6", "react-router-dom": "^4.2.2", - "react-router-redux": "^4.0.8", + "react-router-redux": "^5.0.0-alpha.9", "react-scripts": "1.1.0", "redux": "^3.7.2", "redux-saga": "^0.16.0" diff --git a/src/App.css b/src/App.css deleted file mode 100644 index c5c6e8a..0000000 --- a/src/App.css +++ /dev/null @@ -1,28 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 80px; -} - -.App-header { - background-color: #222; - height: 150px; - padding: 20px; - color: white; -} - -.App-title { - font-size: 1.5em; -} - -.App-intro { - font-size: large; -} - -@keyframes App-logo-spin { - from { transform: rotate(0deg); } - to { transform: rotate(360deg); } -} diff --git a/src/components/App.js b/src/components/App.js index ff7e302..625cdd5 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -1,19 +1,13 @@ import React, { Component } from 'react'; -import logo from '../logo.svg'; -import '../App.css'; +import { Switch, Route, withRouter } from 'react-router-dom'; +import Feed from './Feed' class App extends Component { render() { return ( -
-
- logo -

Welcome to React

-
-

- To get started, edit src/App.js and save to reload. -

-
+ + + ); } } diff --git a/src/components/Feed.js b/src/components/Feed.js new file mode 100644 index 0000000..600db44 --- /dev/null +++ b/src/components/Feed.js @@ -0,0 +1,5 @@ +import React from 'react' + +export default function Feed({ posts }) { + return +} \ No newline at end of file diff --git a/src/index.css b/src/index.css deleted file mode 100644 index b4cc725..0000000 --- a/src/index.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - margin: 0; - padding: 0; - font-family: sans-serif; -} diff --git a/src/index.js b/src/index.js index cbc3492..80dea42 100644 --- a/src/index.js +++ b/src/index.js @@ -1,29 +1,40 @@ -import React from 'react'; -import { render } from 'react-dom'; -import { AppContainer } from 'react-hot-loader'; -import configureStore, { history } from './store/configureStore'; -import App from './components/App'; -import registerServiceWorker from './registerServiceWorker'; +import 'react-hot-loader/patch' +import React from 'react' +import { render } from 'react-dom' +import { AppContainer } from 'react-hot-loader' +import configureStore, { history } from './store/configureStore' +import App from './components/App' +import registerServiceWorker from './registerServiceWorker' +import { Provider } from 'react-redux' +import { ConnectedRouter } from 'react-router-redux' const store = configureStore(); render( - + + + + + , document.getElementById('root') ); -registerServiceWorker(); - if (module.hot) { - module.hot.accept('./components/App', () => { - const NewApp = require('./components/App').default; - render( - - - , - document.getElementById('root') - ); - }); - } + module.hot.accept('./components/App', () => { + const NewApp = require('./components/App').default; + render( + + + + + + + , + document.getElementById('root') + ); + }); +} + +registerServiceWorker(); \ No newline at end of file diff --git a/src/logo.svg b/src/logo.svg deleted file mode 100644 index 6b60c10..0000000 --- a/src/logo.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/yarn.lock b/yarn.lock index eaef60a..1873146 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5237,9 +5237,13 @@ react-router-dom@^4.2.2: react-router "^4.2.0" warning "^3.0.0" -react-router-redux@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-4.0.8.tgz#227403596b5151e182377dab835b5d45f0f8054e" +react-router-redux@^5.0.0-alpha.9: + version "5.0.0-alpha.9" + resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-5.0.0-alpha.9.tgz#825431516e0e6f1fd93b8807f6bd595e23ec3d10" + dependencies: + history "^4.7.2" + prop-types "^15.6.0" + react-router "^4.2.0" react-router@^4.2.0: version "4.2.0"