-
-
Save kvnam/77bf73d954d84053d5d10dcecf93b841 to your computer and use it in GitHub Desktop.
ReactPress App.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Route } from 'react-router-dom'; | |
import { AnimatedSwitch } from 'react-router-transition'; | |
import Navigation from './containers/Navigation/Navigation'; | |
import Blog from './containers/Blog/Blog'; | |
import SinglePost from './components/Post/SinglePost'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div> | |
<Navigation /> | |
</div> | |
<AnimatedSwitch | |
atEnter={{opacity: 0}} | |
atLeave={{opacity: 0}} | |
atActive={{opacity: 1}} | |
className="switch-wrapper"> | |
<Route path="/post" exact component={SinglePost} /> | |
<Route path="/auth" exact render={() => <div>Signin Data</div>} /> | |
<Route path="/" exact component={Blog}/> | |
</AnimatedSwitch> | |
</div> | |
); | |
} | |
} | |
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
const axiosInstance = axios.create({ | |
baseURL: 'http://dev.bluekrill.com/demoWP/wp-json' | |
}); | |
export default axiosInstance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Provider } from 'react-redux'; | |
import { createStore, applyMiddleware } from 'redux'; | |
import thunk from 'redux-thunk'; | |
import PostReducer from './store/reducers/posts.reducer'; | |
const appStore = createStore(appReducer, applyMiddleware(thunk)); | |
const app = ( | |
<BrowserRouter> | |
<Provider store={appStore}> | |
<App /> | |
</Provider> | |
</BrowserRouter> | |
); | |
ReactDOM.render(app, document.getElementById('root')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment