feat: add mobile slider and minor changes according figma

This commit is contained in:
2025-05-20 18:38:56 +05:00
parent d07707020d
commit a97e9b5008
15 changed files with 213 additions and 54 deletions
+9 -9
View File
@@ -1,8 +1,8 @@
import { Dispatch, SetStateAction, useEffect } from "react";
import FullScreenIcon from "./icons/FullScreenIcon";
import Button from "./ui/Button";
import CloseFullscreenIcon from "./icons/CloseFullscreenIcon";
import { isMobileSafari } from "react-device-detect";
import { Dispatch, SetStateAction, useEffect } from 'react';
import FullScreenIcon from './icons/FullScreenIcon';
import Button from './ui/Button';
import CloseFullscreenIcon from './icons/CloseFullscreenIcon';
import { isMobileSafari } from 'react-device-detect';
interface IFullScreenProps {
onFullScreenChange: Dispatch<SetStateAction<boolean>>;
@@ -17,12 +17,12 @@ function FullScreenButton({
}: IFullScreenProps) {
useEffect(() => {
onFullScreenChange(!!document.fullscreenElement);
document.addEventListener("fullscreenchange", () =>
document.addEventListener('fullscreenchange', () =>
onFullScreenChange(!!document.fullscreenElement)
);
return () =>
document.removeEventListener("fullscreenchange", () =>
document.removeEventListener('fullscreenchange', () =>
onFullScreenChange(!!document.fullscreenElement)
);
}, [onFullScreenChange]);
@@ -30,8 +30,8 @@ function FullScreenButton({
if (isMobileSafari) return null;
return (
<Button onlyIcon size="small" variant="secondary" onClick={handleClick}>
<span className="2xl:w-[1.111vw] 2xl:h-[1.111vw] w-4 h-4">
<Button onlyIcon size='small' variant='secondary' onClick={handleClick}>
<span className='2xl:w-[1.389vw] 2xl:h-[1.389vw] w-5 h-5'>
{isFullScreen ? <CloseFullscreenIcon /> : <FullScreenIcon />}
</span>
</Button>