diff --git a/src/components/Home.js b/src/components/Home.js index ecfd4f4..03e7901 100644 --- a/src/components/Home.js +++ b/src/components/Home.js @@ -7,17 +7,29 @@ function Home() { const categories = useSelector((state) => state.shows.categories); const allCategories = ['All', ...categories]; const shows = useSelector((state) => state.shows.Shows); - const bgColors = ['#0C2340', '#1D428A']; - const [filteredCategory, setFilteredCategory] = useState('All'); const filteredShows = filteredCategory === 'All' ? shows : shows.filter((show) => show.category.includes(filteredCategory)); + const handleCategory = (event) => { setFilteredCategory(event.target.value); }; + const renderBackgroundColor = (index) => { + const patternIndex = index % 8; + if ( + patternIndex === 0 + || patternIndex === 3 + || patternIndex === 4 + || patternIndex === 7 + ) { + return '#0C2340'; + } + return '#1D428A'; + }; + return ( <>