App renders slideshow picker on main index page.
This commit is contained in:
parent
09a920f3b3
commit
439ac9945c
19
src/App.js
Normal file
19
src/App.js
Normal file
@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import RedditSlideshow from './components/RedditSlideshow/RedditSlideshow';
|
||||
import SlideshowPicker from './components/SlideshowPicker/SlideshowPicker';
|
||||
|
||||
const App = () => {
|
||||
const shouldRenderPicker = !window.location.pathname || window.location.pathname === '/';
|
||||
|
||||
if (shouldRenderPicker) {
|
||||
return (
|
||||
<SlideshowPicker />
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<RedditSlideshow />
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
import axios from 'axios';
|
||||
|
||||
import App from './containers/App';
|
||||
import App from './App';
|
||||
import './index.css';
|
||||
|
||||
axios.defaults.baseURL = "https://www.reddit.com";
|
||||
|
Loading…
Reference in New Issue
Block a user