diff --git a/web/src/components/Carousel.js b/web/src/components/carousel.js.bak similarity index 98% rename from web/src/components/Carousel.js rename to web/src/components/carousel.js.bak index 4ba350382..d8308067d 100644 --- a/web/src/components/Carousel.js +++ b/web/src/components/carousel.js.bak @@ -174,7 +174,8 @@ function Carousel({ > {data && data.length > 0 ? data.map((item, i) => { - if (item === 'watched') return null; + if (!item || item.length === 0 || item === 'watched') + return null; if (type === 'request') { return ( diff --git a/web/src/pages/index.js b/web/src/pages/index.js index cbee6fb03..ee2c63311 100644 --- a/web/src/pages/index.js +++ b/web/src/pages/index.js @@ -4,7 +4,7 @@ import 'react-lazy-load-image-component/src/effects/opacity.css'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; -import Carousel from '../components/carousel'; +import Carousel from '../components/Carousel'; import Hero from '../components/hero'; import { Loading } from '../components/loading'; import Meta from '../components/meta'; diff --git a/web/src/pages/search.js b/web/src/pages/search.js deleted file mode 100644 index 1fc40d715..000000000 --- a/web/src/pages/search.js +++ /dev/null @@ -1,105 +0,0 @@ -import { useEffect, useState } from 'react'; -import { connect } from 'react-redux'; -import { useHistory } from 'react-router-dom'; - -import Carousel from '../components/carousel'; -import Meta from '../components/meta'; -import media from '../services/media.service'; -import typo from '../styles/components/typography.module.scss'; -import styles from '../styles/views/search.module.scss'; - -const mapStateToProps = (state) => { - return { - searchQuery: state.media.searchQuery, - searchResults: state.media.searchResults, - }; -}; - -function Search({ searchQuery, searchResults, newNotification }) { - const [loading, setLoading] = useState(false); - const history = useHistory(); - - useEffect(() => { - // clearResults() - // setLoading(true); - async function submitSearch() { - try { - await media.search(searchQuery); - setLoading(false); - } catch (e) { - newNotification({ type: 'error', message: e }); - setLoading(false); - } - } - if (searchQuery.length === 0) { - history.push('/'); - return; - } - const to = setTimeout(() => { - submitSearch(); - }, 500); - return () => clearTimeout(to); - // eslint-disable-next-line - }, [searchQuery]); - return ( -
Search Results for:
-{searchQuery}
-No results
-