This commit is contained in:
qier222 2023-09-04 12:51:56 +08:00
parent 32050e4553
commit 6aee8ae38e
No known key found for this signature in database
41 changed files with 523 additions and 415 deletions

View file

@ -6,12 +6,14 @@ import Slider from '@/web/components/Slider'
import { cx } from '@emotion/css'
import player from '@/web/states/player'
import { ceil } from 'lodash'
import { useMutation, useQuery } from '@tanstack/react-query'
import { IpcChannels } from '@/shared/IpcChannels'
import { useCopyToClipboard } from 'react-use'
function Player() {
return (
<div className={cx(`space-y-7`)}>
<FindTrackOnYouTube />
<VolumeSlider />
</div>
)
}
@ -59,31 +61,4 @@ function FindTrackOnYouTube() {
)
}
function VolumeSlider() {
const { t } = useTranslation()
const { volume } = useSnapshot(player)
const onChange = (volume: number) => {
player.volume = volume
}
return (
<div>
<BlockTitle>{t(`settings.volume-control`)}</BlockTitle>
<div className='pt-2 pr-1'>
<Slider
value={volume}
min={0}
max={1}
onChange={onChange}
alwaysShowTrack
alwaysShowThumb
/>
</div>
<div className='mt-1 flex justify-between text-14 font-bold text-neutral-100'>
<span>0</span>
<span>{ceil(volume * 100)}</span>
</div>
</div>
)
}
export default Player