Add Share to Context menus, also share artist
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
openExtendedInfoDialog,
|
||||
DOWNLOAD_MENU_ALBUM,
|
||||
DOWNLOAD_MENU_ARTIST,
|
||||
openShareMenu,
|
||||
} from '../actions'
|
||||
import { LoveButton } from './LoveButton'
|
||||
import config from '../config'
|
||||
@@ -79,12 +80,18 @@ const ContextMenu = ({
|
||||
label: translate('resources.album.actions.addToPlaylist'),
|
||||
action: (data, ids) => dispatch(openAddToPlaylist({ selectedIds: ids })),
|
||||
},
|
||||
share: {
|
||||
enabled: config.devEnableShare,
|
||||
needData: false,
|
||||
label: translate('ra.action.share'),
|
||||
action: (record) => {
|
||||
dispatch(openShareMenu([record.id], resource, record.name))
|
||||
},
|
||||
},
|
||||
download: {
|
||||
enabled: config.enableDownloads && record.size,
|
||||
needData: false,
|
||||
label: `${translate('resources.album.actions.download')} (${formatBytes(
|
||||
record.size
|
||||
)})`,
|
||||
label: `${translate('ra.action.download')} (${formatBytes(record.size)})`,
|
||||
action: () => {
|
||||
dispatch(
|
||||
openDownloadMenu(
|
||||
@@ -141,7 +148,7 @@ const ContextMenu = ({
|
||||
notify('ra.page.error', 'warning')
|
||||
})
|
||||
} else {
|
||||
options[key].action()
|
||||
options[key].action(record)
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
openExtendedInfoDialog,
|
||||
openDownloadMenu,
|
||||
DOWNLOAD_MENU_SONG,
|
||||
openShareMenu,
|
||||
} from '../actions'
|
||||
import { LoveButton } from './LoveButton'
|
||||
import config from '../config'
|
||||
@@ -63,11 +64,16 @@ export const SongContextMenu = ({
|
||||
})
|
||||
),
|
||||
},
|
||||
share: {
|
||||
enabled: config.devEnableShare,
|
||||
label: translate('ra.action.share'),
|
||||
action: (record) => {
|
||||
dispatch(openShareMenu([record.id], 'song', record.title))
|
||||
},
|
||||
},
|
||||
download: {
|
||||
enabled: config.enableDownloads,
|
||||
label: `${translate('resources.song.actions.download')} (${formatBytes(
|
||||
record.size
|
||||
)})`,
|
||||
label: `${translate('ra.action.download')} (${formatBytes(record.size)})`,
|
||||
action: (record) => {
|
||||
dispatch(openDownloadMenu(record, DOWNLOAD_MENU_SONG))
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user