diff --git a/src/WidgetDev.tsx b/src/WidgetDev.tsx index 7da8233..29dd6b3 100644 --- a/src/WidgetDev.tsx +++ b/src/WidgetDev.tsx @@ -1,14 +1,12 @@ import lightTheme from "@/utils/themes/light"; import { Box, ThemeProvider, Typography } from "@mui/material"; import { useEffect, useRef } from "react"; -import { BannerWidget as Widget } from "./widgets"; +import { ContainerWidget as Widget } from "./widgets"; const widgetProps: ConstructorParameters[0] = { quizId: "3c49550d-8c77-4788-bc2d-42586a261514", - position: "bottomleft", - pulsation: true, - rounded: true, + selector: "#widget-container", }; export default function WidgetDev() { @@ -32,6 +30,12 @@ export default function WidgetDev() { > + diff --git a/src/widgets/button/OpenQuizButton.tsx b/src/widgets/button/OpenQuizButton.tsx index fe28a2d..f60ba3a 100644 --- a/src/widgets/button/OpenQuizButton.tsx +++ b/src/widgets/button/OpenQuizButton.tsx @@ -12,7 +12,7 @@ const WIDGET_DEFAULT_HEIGHT = "80%"; interface Props { quizId: string; fixedSide?: "left" | "right"; - dimensions?: { width: string; height: string; }; + dialogDimensions?: { width: string; height: string; }; /** * Открыть квиз через X секунд, 0 - сразу */ @@ -31,7 +31,7 @@ export default function OpenQuizButton({ quizId, fixedSide, autoShowQuizTime = null, - dimensions, + dialogDimensions, hideOnMobile, openOnLeaveAttempt, buttonFlash = false, @@ -128,8 +128,8 @@ export default function OpenQuizButton({ quizId={quizId} onClose={() => setIsQuizShown(false)} paperSx={{ - width: dimensions?.width ?? WIDGET_DEFAULT_WIDTH, - height: dimensions?.height ?? WIDGET_DEFAULT_HEIGHT, + width: dialogDimensions?.width ?? WIDGET_DEFAULT_WIDTH, + height: dialogDimensions?.height ?? WIDGET_DEFAULT_HEIGHT, }} /> diff --git a/src/widgets/popup/QuizPopup.tsx b/src/widgets/popup/QuizPopup.tsx index 068068e..681c844 100644 --- a/src/widgets/popup/QuizPopup.tsx +++ b/src/widgets/popup/QuizPopup.tsx @@ -9,7 +9,7 @@ const WIDGET_DEFAULT_HEIGHT = "80%"; interface Props { quizId: string; - dimensions?: { width: string; height: string; }; + dialogDimensions?: { width: string; height: string; }; /** * Открыть квиз через X секунд, 0 - сразу */ @@ -20,7 +20,7 @@ interface Props { export default function QuizPopup({ quizId, - dimensions, + dialogDimensions, autoShowQuizTime = null, hideOnMobile = false, openOnLeaveAttempt = false, @@ -70,8 +70,8 @@ export default function QuizPopup({ quizId={quizId} onClose={() => setIsQuizShown(false)} paperSx={{ - width: dimensions?.width ?? WIDGET_DEFAULT_WIDTH, - height: dimensions?.height ?? WIDGET_DEFAULT_HEIGHT, + width: dialogDimensions?.width ?? WIDGET_DEFAULT_WIDTH, + height: dialogDimensions?.height ?? WIDGET_DEFAULT_HEIGHT, }} /> ); diff --git a/src/widgets/side/QuizSideButton.tsx b/src/widgets/side/QuizSideButton.tsx index 0d145f0..aaa78a4 100644 --- a/src/widgets/side/QuizSideButton.tsx +++ b/src/widgets/side/QuizSideButton.tsx @@ -17,7 +17,7 @@ interface Props { position: "left" | "right"; buttonBackgroundColor?: string; buttonTextColor?: string; - dimensions?: { width: string; height: string; }; + dialogDimensions?: { width: string; height: string; }; fullScreen?: boolean; buttonFlash?: boolean; /** @@ -36,7 +36,7 @@ export default function QuizSideButton({ position, buttonBackgroundColor, buttonTextColor, - dimensions, + dialogDimensions, fullScreen = false, buttonFlash = false, autoOpenTime = 0, @@ -87,9 +87,9 @@ export default function QuizSideButton({ bottom: PADDING, right: position === "right" ? PADDING : undefined, left: position === "left" ? PADDING : undefined, - width: dimensions?.width ?? WIDGET_DEFAULT_WIDTH, + width: dialogDimensions?.width ?? WIDGET_DEFAULT_WIDTH, maxWidth: `calc(100% - ${PADDING * 2}px)`, - height: dimensions?.height ?? WIDGET_DEFAULT_HEIGHT, + height: dialogDimensions?.height ?? WIDGET_DEFAULT_HEIGHT, maxHeight: `calc(100% - ${PADDING * 2}px)`, }, (isMobile || fullScreen) && {