mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
added favorites
tab
This commit is contained in:
parent
596d0567a5
commit
a9bbef6d02
@ -11,8 +11,8 @@ import { WithPlayerContext } from "contexts/WithPlayerContext"
|
||||
import FeedModel from "models/feed"
|
||||
import PlaylistModel from "models/playlists"
|
||||
|
||||
import MusicTrack from "components/MusicTrack"
|
||||
import PlaylistItem from "components/PlaylistItem"
|
||||
import MusicTrack from "components/Music/Track"
|
||||
import PlaylistItem from "components/Music/PlaylistItem"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
@ -146,8 +146,6 @@ const PlaylistsList = (props) => {
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
|
||||
const ResultGroupsDecorators = {
|
||||
"playlists": {
|
||||
icon: "MdPlaylistPlay",
|
32
packages/app/src/pages/music/components/favorites/index.jsx
Normal file
32
packages/app/src/pages/music/components/favorites/index.jsx
Normal file
@ -0,0 +1,32 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
|
||||
import PlaylistView from "components/Music/PlaylistView"
|
||||
|
||||
import MusicModel from "comty.js/models/music"
|
||||
|
||||
export default () => {
|
||||
const [L_Favorites, R_Favorites, E_Favorites] = app.cores.api.useRequest(MusicModel.getFavorites)
|
||||
|
||||
if (E_Favorites) {
|
||||
return <antd.Result
|
||||
status="error"
|
||||
title="Error"
|
||||
subTitle={E_Favorites.message}
|
||||
/>
|
||||
}
|
||||
|
||||
if (L_Favorites) {
|
||||
return <antd.Skeleton active />
|
||||
}
|
||||
|
||||
return <PlaylistView
|
||||
type="vertical"
|
||||
playlist={{
|
||||
title: "Your favorites",
|
||||
cover: "https://storage.ragestudio.net/comty-static-assets/favorite_song.png",
|
||||
list: R_Favorites
|
||||
}}
|
||||
centered={app.isMobile}
|
||||
/>
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
import React from "react"
|
||||
|
||||
export default () => {
|
||||
return <div>
|
||||
|
||||
</div>
|
||||
}
|
@ -15,6 +15,7 @@ export default () => {
|
||||
return <PagePanelWithNavMenu
|
||||
tabs={Tabs}
|
||||
navMenuHeader={NavMenuHeader}
|
||||
defaultTab="explore"
|
||||
primaryPanelClassName="full"
|
||||
useSetQueryType
|
||||
transition
|
||||
|
@ -1,34 +1,34 @@
|
||||
import FeedTab from "./components/feed"
|
||||
import SpacesTab from "./components/spaces"
|
||||
|
||||
import LibraryTab from "./components/library"
|
||||
import FavoritesTab from "./components/favorites"
|
||||
import ExploreTab from "./components/explore"
|
||||
import DashboardTab from "./components/dashboard"
|
||||
|
||||
import ReleasesTab from "./components/dashboard/releases"
|
||||
|
||||
export default [
|
||||
{
|
||||
key: "feed",
|
||||
label: "Feed",
|
||||
key: "explore",
|
||||
label: "Explore",
|
||||
icon: "Compass",
|
||||
component: FeedTab
|
||||
},
|
||||
{
|
||||
key: "radio",
|
||||
label: "Radio",
|
||||
icon: "Radio",
|
||||
disabled: true
|
||||
component: ExploreTab
|
||||
},
|
||||
{
|
||||
key: "library",
|
||||
label: "Library",
|
||||
icon: "MdLibraryMusic",
|
||||
component: FeedTab,
|
||||
disabled: true
|
||||
disabled: true,
|
||||
component: LibraryTab,
|
||||
},
|
||||
{
|
||||
key: "spaces",
|
||||
label: "Spaces",
|
||||
icon: "MdDeck",
|
||||
component: SpacesTab,
|
||||
key: "favorites",
|
||||
label: "Favorites",
|
||||
icon: "MdFavoriteBorder",
|
||||
component: FavoritesTab,
|
||||
},
|
||||
{
|
||||
key: "radio",
|
||||
label: "Radio",
|
||||
icon: "Radio",
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user