-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.jsx
43 lines (37 loc) · 1.61 KB
/
App.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { useSelector } from 'react-redux';
import { Route, Routes } from 'react-router-dom';
import { Searchbar, Sidebar, MusicPlayer, TopPlay } from './components';
import { ArtistDetails, TopArtists, AroundYou, Discover, Search, SongDetails, TopCharts } from './pages';
const App = () => {
const { activeSong } = useSelector((state) => state.player);
return (
<div className="relative flex">
<Sidebar />
<div className="flex-1 flex flex-col bg-gradient-to-br from-black to-[#121286]">
<Searchbar />
<div className="px-6 h-[calc(100vh-72px)] overflow-y-scroll hide-scrollbar flex xl:flex-row flex-col-reverse">
<div className="flex-1 h-fit pb-40">
<Routes>
<Route path="/" element={<Discover />} />
<Route path="/top-artists" element={<TopArtists />} />
<Route path="/top-charts" element={<TopCharts />} />
<Route path="/around-you" element={<AroundYou />} />
<Route path="/artists/:id" element={<ArtistDetails />} />
<Route path="/songs/:songid" element={<SongDetails />} />
<Route path="/search/:searchTerm" element={<Search />} />
</Routes>
</div>
<div className="xl:sticky relative top-0 h-fit">
<TopPlay />
</div>
</div>
</div>
{activeSong?.title && (
<div className="absolute h-28 bottom-0 left-0 right-0 flex animate-slideup bg-gradient-to-br from-white/10 to-[#2a2a80] backdrop-blur-lg rounded-t-3xl z-10">
<MusicPlayer />
</div>
)}
</div>
);
};
export default App;