From 5e965ae65fbf7c03bac0ada2f268fe66bb1188e1 Mon Sep 17 00:00:00 2001 From: nflnkr Date: Sat, 4 May 2024 18:22:47 +0300 Subject: [PATCH] add side widget fullScreen param --- src/widgets/QuizDialog.tsx | 2 +- src/widgets/side/QuizSideButton.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/QuizDialog.tsx b/src/widgets/QuizDialog.tsx index e2c5517..4429a3a 100644 --- a/src/widgets/QuizDialog.tsx +++ b/src/widgets/QuizDialog.tsx @@ -62,7 +62,7 @@ export default function QuizDialog({ top: 0, right: 0, backgroundColor: "rgba(0, 0, 0, 0.5)", - borderTopRightRadius: "4px", + borderTopRightRadius: 0, borderTopLeftRadius: 0, borderBottomLeftRadius: "4px", borderBottomRightRadius: 0, diff --git a/src/widgets/side/QuizSideButton.tsx b/src/widgets/side/QuizSideButton.tsx index 9d300cf..57118b6 100644 --- a/src/widgets/side/QuizSideButton.tsx +++ b/src/widgets/side/QuizSideButton.tsx @@ -14,9 +14,10 @@ interface Props { position: "left" | "right"; buttonBackgroundColor?: string; dimensions?: { width: string; height: string; }; + fullScreen?: boolean; } -export default function QuizSideButton({ quizId, position, buttonBackgroundColor, dimensions }: Props) { +export default function QuizSideButton({ quizId, position, buttonBackgroundColor, dimensions, fullScreen = false }: Props) { const [isQuizShown, setIsQuizShown] = useState(false); const isMobile = useMediaQuery("(max-width: 600px)"); @@ -32,7 +33,7 @@ export default function QuizSideButton({ quizId, position, buttonBackgroundColor { m: 0, }, - !isMobile && { + (!isMobile && !fullScreen) && { position: "absolute", bottom: PADDING, right: position === "right" ? PADDING : undefined, @@ -42,7 +43,7 @@ export default function QuizSideButton({ quizId, position, buttonBackgroundColor height: dimensions?.height ?? WIDGET_DEFAULT_HEIGHT, maxHeight: `calc(100% - ${PADDING * 2}px)`, }, - isMobile && { + (isMobile || fullScreen) && { position: "relative", width: "100%", height: "100%",