App renders slideshow picker on main index page.

This commit is contained in:
moonstar-x 2023-06-02 12:37:04 -05:00
parent 09a920f3b3
commit 439ac9945c
2 changed files with 20 additions and 1 deletions

19
src/App.js Normal file
View 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;

View File

@ -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";