From 439ac9945c8cfa9876b874f45425ef6d7fd40f2a Mon Sep 17 00:00:00 2001 From: moonstar-x Date: Fri, 2 Jun 2023 12:37:04 -0500 Subject: [PATCH] App renders slideshow picker on main index page. --- src/App.js | 19 +++++++++++++++++++ src/index.js | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/App.js 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";