mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 13:40:24 +02:00
Feature: Shuffle Button (#941)
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
|||||||
RiAlbumFill,
|
RiAlbumFill,
|
||||||
RiPlayFill,
|
RiPlayFill,
|
||||||
RiPlayListFill,
|
RiPlayListFill,
|
||||||
|
RiShuffleFill,
|
||||||
RiUserVoiceFill,
|
RiUserVoiceFill,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
@@ -168,6 +169,21 @@ export const LibraryCommandItem = ({
|
|||||||
>
|
>
|
||||||
<RiPlayFill />
|
<RiPlayFill />
|
||||||
</Button>
|
</Button>
|
||||||
|
{itemType !== LibraryItem.SONG && (
|
||||||
|
<Button
|
||||||
|
compact
|
||||||
|
disabled={disabled}
|
||||||
|
onClick={(e) => handlePlay(e, id, Play.SHUFFLE)}
|
||||||
|
size="md"
|
||||||
|
tooltip={{
|
||||||
|
label: t('player.shuffle', { postProcess: 'sentenceCase' }),
|
||||||
|
openDelay: 500,
|
||||||
|
}}
|
||||||
|
variant="default"
|
||||||
|
>
|
||||||
|
<RiShuffleFill />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
compact
|
compact
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ export const PLAY_TYPES = [
|
|||||||
label: i18n.t('player.play', { postProcess: 'sentenceCase' }),
|
label: i18n.t('player.play', { postProcess: 'sentenceCase' }),
|
||||||
play: Play.NOW,
|
play: Play.NOW,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: i18n.t('player.shuffle', { postProcess: 'sentenceCase' }),
|
||||||
|
play: Play.SHUFFLE,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: i18n.t('player.addLast', { postProcess: 'sentenceCase' }),
|
label: i18n.t('player.addLast', { postProcess: 'sentenceCase' }),
|
||||||
play: Play.LAST,
|
play: Play.LAST,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
RiArrowDownSLine,
|
RiArrowDownSLine,
|
||||||
RiArrowUpSLine,
|
RiArrowUpSLine,
|
||||||
RiPlayFill,
|
RiPlayFill,
|
||||||
|
RiShuffleFill,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
import { generatePath } from 'react-router';
|
import { generatePath } from 'react-router';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
@@ -138,6 +139,21 @@ const PlaylistRow = ({ data, index, style }: ListChildComponentProps) => {
|
|||||||
>
|
>
|
||||||
<RiPlayFill />
|
<RiPlayFill />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
compact
|
||||||
|
onClick={() => {
|
||||||
|
if (!data?.items?.[index].id) return;
|
||||||
|
data.handlePlay(data?.items[index].id, Play.SHUFFLE);
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
tooltip={{
|
||||||
|
label: t('player.shuffle', { postProcess: 'sentenceCase' }),
|
||||||
|
openDelay: 500,
|
||||||
|
}}
|
||||||
|
variant="default"
|
||||||
|
>
|
||||||
|
<RiShuffleFill />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
compact
|
compact
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
RiPlayFill,
|
RiPlayFill,
|
||||||
RiRefreshLine,
|
RiRefreshLine,
|
||||||
RiSettings3Fill,
|
RiSettings3Fill,
|
||||||
|
RiShuffleFill,
|
||||||
} from 'react-icons/ri';
|
} from 'react-icons/ri';
|
||||||
|
|
||||||
import i18n from '/@/i18n/i18n';
|
import i18n from '/@/i18n/i18n';
|
||||||
@@ -594,6 +595,12 @@ export const SongListHeaderFilters = ({
|
|||||||
>
|
>
|
||||||
{t('player.play', { postProcess: 'sentenceCase' })}
|
{t('player.play', { postProcess: 'sentenceCase' })}
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
|
<DropdownMenu.Item
|
||||||
|
icon={<RiShuffleFill />}
|
||||||
|
onClick={() => handlePlay?.({ playType: Play.SHUFFLE })}
|
||||||
|
>
|
||||||
|
{t('player.shuffle', { postProcess: 'sentenceCase' })}
|
||||||
|
</DropdownMenu.Item>
|
||||||
<DropdownMenu.Item
|
<DropdownMenu.Item
|
||||||
icon={<RiAddBoxFill />}
|
icon={<RiAddBoxFill />}
|
||||||
onClick={() => handlePlay?.({ playType: Play.LAST })}
|
onClick={() => handlePlay?.({ playType: Play.LAST })}
|
||||||
|
|||||||
Reference in New Issue
Block a user