diff --git a/src/App.js b/src/App.js new file mode 100644 index 0000000..6e8cc68 --- /dev/null +++ b/src/App.js @@ -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 ( + + ); + } + + return ( + + ); +}; + +export default App; diff --git a/src/index.js b/src/index.js index 33e96e5..5a47e59 100644 --- a/src/index.js +++ b/src/index.js @@ -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";