From 24b30f24bb4e092b56cddb8770594f0460e98d94 Mon Sep 17 00:00:00 2001 From: Pas <74743263+Pasithea0@users.noreply.github.com> Date: Mon, 10 Feb 2025 23:06:09 -0700 Subject: [PATCH] add preview to captions settings atoms --- .../positions/OverlayMobilePosition.tsx | 67 +++++++++++++------ .../atoms/settings/CaptionSettingsView.tsx | 4 +- 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/src/components/overlays/positions/OverlayMobilePosition.tsx b/src/components/overlays/positions/OverlayMobilePosition.tsx index 53b21000..36a3bee6 100644 --- a/src/components/overlays/positions/OverlayMobilePosition.tsx +++ b/src/components/overlays/positions/OverlayMobilePosition.tsx @@ -1,7 +1,8 @@ import classNames from "classnames"; -import { ReactNode } from "react"; +import { ReactNode, useState } from "react"; import { useTranslation } from "react-i18next"; +import { Icon, Icons } from "@/components/Icon"; import { useInternalOverlayRouter } from "@/hooks/useOverlayRouter"; interface MobilePositionProps { @@ -10,28 +11,56 @@ interface MobilePositionProps { } export function OverlayMobilePosition(props: MobilePositionProps) { + const [isPreviewMode, setIsPreviewMode] = useState(false); const router = useInternalOverlayRouter("hello world :)"); const { t } = useTranslation(); - return ( -
- {props.children} + const togglePreview = () => { + setIsPreviewMode(!isPreviewMode); + }; - {/* Close button */} - + ) : null} + + {/* Main Overlay */} +
- {t("overlays.close")} - - {/* Gradient to hide the progress */} -
-
+ {props.children} + + {/* Close button */} + + {/* Gradient to hide the progress */} +
+
+ ); } diff --git a/src/components/player/atoms/settings/CaptionSettingsView.tsx b/src/components/player/atoms/settings/CaptionSettingsView.tsx index eeaa0d48..d953fbf0 100644 --- a/src/components/player/atoms/settings/CaptionSettingsView.tsx +++ b/src/components/player/atoms/settings/CaptionSettingsView.tsx @@ -264,8 +264,8 @@ export function CaptionSettingsView({ setDelay(v)} value={delay} textTransformer={(s) => `${s}s`}