Move Playlists to the sidebar menu (#1339)

* Show playlists in sidebar menu

* Fix menu

* Refresh playlist submenu when adding new playlist

* Group shared playlists below user's playlists

* Fix text overflow in menu options

* Add button in playlist menu to go to Playlists list

* Add config option `DevSidebarPlaylists` to enable this feature (default false)
This commit is contained in:
Deluan Quintão
2021-09-11 13:11:15 -04:00
committed by GitHub
parent a7017e4bb0
commit 79363d6c07
11 changed files with 211 additions and 17 deletions
+8 -1
View File
@@ -1,6 +1,11 @@
import React, { useState } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { useDataProvider, useNotify, useTranslate } from 'react-admin'
import {
useDataProvider,
useNotify,
useRefresh,
useTranslate,
} from 'react-admin'
import {
Button,
Dialog,
@@ -22,6 +27,7 @@ export const AddToPlaylistDialog = () => {
const dispatch = useDispatch()
const translate = useTranslate()
const notify = useNotify()
const refresh = useRefresh()
const [value, setValue] = useState({})
const [check, setCheck] = useState(false)
const dataProvider = useDataProvider()
@@ -47,6 +53,7 @@ export const AddToPlaylistDialog = () => {
const len = trackIds.length
notify('message.songsAddedToPlaylist', 'info', { smart_count: len })
onSuccess && onSuccess(value, len)
refresh()
})
.catch(() => {
notify('ra.page.error', 'warning')