mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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 FeedModel from "models/feed"
|
||||||
import PlaylistModel from "models/playlists"
|
import PlaylistModel from "models/playlists"
|
||||||
|
|
||||||
import MusicTrack from "components/MusicTrack"
|
import MusicTrack from "components/Music/Track"
|
||||||
import PlaylistItem from "components/PlaylistItem"
|
import PlaylistItem from "components/Music/PlaylistItem"
|
||||||
|
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
@ -146,8 +146,6 @@ const PlaylistsList = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ResultGroupsDecorators = {
|
const ResultGroupsDecorators = {
|
||||||
"playlists": {
|
"playlists": {
|
||||||
icon: "MdPlaylistPlay",
|
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
|
return <PagePanelWithNavMenu
|
||||||
tabs={Tabs}
|
tabs={Tabs}
|
||||||
navMenuHeader={NavMenuHeader}
|
navMenuHeader={NavMenuHeader}
|
||||||
|
defaultTab="explore"
|
||||||
primaryPanelClassName="full"
|
primaryPanelClassName="full"
|
||||||
useSetQueryType
|
useSetQueryType
|
||||||
transition
|
transition
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
import FeedTab from "./components/feed"
|
import LibraryTab from "./components/library"
|
||||||
import SpacesTab from "./components/spaces"
|
import FavoritesTab from "./components/favorites"
|
||||||
|
import ExploreTab from "./components/explore"
|
||||||
import DashboardTab from "./components/dashboard"
|
import DashboardTab from "./components/dashboard"
|
||||||
|
|
||||||
import ReleasesTab from "./components/dashboard/releases"
|
import ReleasesTab from "./components/dashboard/releases"
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
key: "feed",
|
key: "explore",
|
||||||
label: "Feed",
|
label: "Explore",
|
||||||
icon: "Compass",
|
icon: "Compass",
|
||||||
component: FeedTab
|
component: ExploreTab
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "radio",
|
|
||||||
label: "Radio",
|
|
||||||
icon: "Radio",
|
|
||||||
disabled: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "library",
|
key: "library",
|
||||||
label: "Library",
|
label: "Library",
|
||||||
icon: "MdLibraryMusic",
|
icon: "MdLibraryMusic",
|
||||||
component: FeedTab,
|
disabled: true,
|
||||||
disabled: true
|
component: LibraryTab,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "spaces",
|
key: "favorites",
|
||||||
label: "Spaces",
|
label: "Favorites",
|
||||||
icon: "MdDeck",
|
icon: "MdFavoriteBorder",
|
||||||
component: SpacesTab,
|
component: FavoritesTab,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "radio",
|
||||||
|
label: "Radio",
|
||||||
|
icon: "Radio",
|
||||||
disabled: true
|
disabled: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user