From 57a1f3f140ace067c2cafe04ef4962a0e5ed567a Mon Sep 17 00:00:00 2001 From: Haziq Khairi Date: Fri, 19 Jan 2024 10:33:22 +0800 Subject: [PATCH] chore: remove unused file --- src/matrepbuat.jsx | 166 --------------------------------------------- 1 file changed, 166 deletions(-) delete mode 100644 src/matrepbuat.jsx diff --git a/src/matrepbuat.jsx b/src/matrepbuat.jsx deleted file mode 100644 index 1634a6a..0000000 --- a/src/matrepbuat.jsx +++ /dev/null @@ -1,166 +0,0 @@ -import { Tooltip } from '@nextui-org/react'; -import { useState, useEffect } from 'react'; -import { categories } from './data/categories'; -import { landscapesList } from './data/landscapes-list'; -import { paintingsList } from './data/paintings-list'; -import { portraitsList } from './data/portraits-list'; -import { abstractsList } from './data/abstracts-list'; - -const shuffleArray = (array) => { - const shuffledArray = [...array]; - for (let i = shuffledArray.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - [shuffledArray[i], shuffledArray[j]] = [shuffledArray[j], shuffledArray[i]]; - } - return shuffledArray; -}; - -function App() { - // Combine data from landscapesList, paintingsList, and portraitsList - const combinedList = [ - ...landscapesList, - ...paintingsList, - ...portraitsList, - ...abstractsList, - ]; - - // Shuffle the combined list - const shuffledList = shuffleArray(combinedList); - - // State to hold the new list - const [newList, setNewList] = useState([]); - - useEffect(() => { - // Combine and shuffle the lists when the component mounts - const combinedAndShuffledList = shuffleArray([ - ...landscapesList, - ...paintingsList, - ...portraitsList, - ...abstractsList, - ]); - setNewList(combinedAndShuffledList); - }, []); - - // Limit the number of items to show in the Top Picks section - const limitedTopPicksList = newList.slice(0, 7); - - // Limit the number of items to show in the More Arts section - const limitedMoreArtsList = shuffledList.slice(0, 6); // Change the number as needed - - // Separate limitedMoreArtsList into two parts - const moreArtsContainer1List = limitedMoreArtsList.slice(0, 3); - const moreArtsContainer2List = limitedMoreArtsList.slice(3, 6); - - return ( -
-
ArtistryHub.
-

Explore our world of creative designs.

- -
-

Categories

- -
- {categories.map((category) => ( - -
-
- {category.name} -
-
-
- ))} -
- -
- -
-

Top Picks

-
-
- {limitedTopPicksList.map((item) => ( - -
-
- {item.name} -
-
-
- ))} -
-
- -
- -
-

More Arts

-
-
-
- {moreArtsContainer1List.map((item) => ( - -
-
- {item.name} -
-
-
- ))} -
- -
- {moreArtsContainer2List.map((item) => ( - -
-
- {item.name} -
-
-
- ))} -
-
-
-
-
- ); -} - -export default App;