From 21f81d56e5c3f68dc19ab3e6c5c1ddc5c0e9ed87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Wed, 27 Nov 2024 19:42:36 +0300 Subject: [PATCH] feat: changed icons for forward, backward --- public/ForwardIcon.svg | 5 ++ public/RewindIcon.svg | 5 ++ .../components/PlayerContols/index.tsx | 49 +++++++++++++++++-- 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 public/ForwardIcon.svg create mode 100644 public/RewindIcon.svg diff --git a/public/ForwardIcon.svg b/public/ForwardIcon.svg new file mode 100644 index 000000000..6bfe75d26 --- /dev/null +++ b/public/ForwardIcon.svg @@ -0,0 +1,5 @@ + + + diff --git a/public/RewindIcon.svg b/public/RewindIcon.svg new file mode 100644 index 000000000..6a20c89cd --- /dev/null +++ b/public/RewindIcon.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/components/mindset/components/PlayerContols/index.tsx b/src/components/mindset/components/PlayerContols/index.tsx index 6f825dd08..9ba8f0e89 100644 --- a/src/components/mindset/components/PlayerContols/index.tsx +++ b/src/components/mindset/components/PlayerContols/index.tsx @@ -1,8 +1,6 @@ import { IconButton } from '@mui/material' import { useCallback } from 'react' import styled from 'styled-components' -import ChevronLeftIcon from '~/components/Icons/ChevronLeftIcon' -import ChevronRightIcon from '~/components/Icons/ChevronRightIcon.js' import PauseIcon from '~/components/Icons/PauseIcon' import PlayIcon from '~/components/Icons/PlayIcon' import { Flex } from '~/components/common/Flex' @@ -31,10 +29,28 @@ export const PlayerControl = ({ markers }: Props) => { [playerRef], ) + const handleRewind = () => { + if (playerRef) { + const newTime = playerRef.getCurrentTime() - 15 + + playerRef.seekTo(newTime, 'seconds') + } + } + + const handleFastForward = () => { + if (playerRef) { + const newTime = playerRef.getCurrentTime() + 15 + + playerRef.seekTo(newTime, 'seconds') + } + } + return showPlayer ? ( - + + + { @@ -45,7 +61,9 @@ export const PlayerControl = ({ markers }: Props) => { > {isPlaying ? : } - + + + {true && (