From 2ea14d81f8c2b7173f5531ca809d29bcbc81570a Mon Sep 17 00:00:00 2001 From: Nastya Date: Sun, 21 Sep 2025 12:55:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B8=D0=B7=D1=83=D0=B0=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D1=82=D0=B0=D0=B9=D0=BC=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewPublicationPage/ApologyPage.tsx | 2 +- .../ViewPublicationPage/Question.tsx | 54 ++++++---- lib/ui_kit/timer/CircularTimer.tsx | 98 +++++++++++++++++++ 3 files changed, 133 insertions(+), 21 deletions(-) create mode 100644 lib/ui_kit/timer/CircularTimer.tsx diff --git a/lib/components/ViewPublicationPage/ApologyPage.tsx b/lib/components/ViewPublicationPage/ApologyPage.tsx index a03f32f..b6bce50 100644 --- a/lib/components/ViewPublicationPage/ApologyPage.tsx +++ b/lib/components/ViewPublicationPage/ApologyPage.tsx @@ -24,7 +24,7 @@ export const ApologyPage = ({ error }: Props) => { color: "text.primary", }} > - {t(message.toLowerCase())} + {/* {t(message.toLowerCase())} */} ); diff --git a/lib/components/ViewPublicationPage/Question.tsx b/lib/components/ViewPublicationPage/Question.tsx index eb45fa3..a9f89cd 100644 --- a/lib/components/ViewPublicationPage/Question.tsx +++ b/lib/components/ViewPublicationPage/Question.tsx @@ -24,6 +24,7 @@ import { DESIGN_LIST } from "@/utils/designList"; import { type ReactNode } from "react"; import { isProduction } from "@/utils/defineDomain"; import { useQuizStore } from "@/stores/useQuizStore"; +import { CustomCircularTimer } from "@/ui_kit/timer/CircularTimer"; type Props = { currentQuestion: RealTypedQuizQuestion; @@ -94,32 +95,45 @@ export const Question = ({ stepNumber={currentQuestionStepNumber} /> {show_badge && ( - - {quizThemes[settings.cfg.theme].isLight ? ( - - ) : ( - - )} - + } + + {quizThemes[settings.cfg.theme].isLight ? ( + + ) : ( + + )} + + )} diff --git a/lib/ui_kit/timer/CircularTimer.tsx b/lib/ui_kit/timer/CircularTimer.tsx new file mode 100644 index 0000000..4d77c18 --- /dev/null +++ b/lib/ui_kit/timer/CircularTimer.tsx @@ -0,0 +1,98 @@ +import { CircularProgress, Box, Typography, useTheme, styled } from "@mui/material"; + +const StyledCircularProgress = styled(CircularProgress)(({ theme }) => ({ + "& .MuiCircularProgress-circle": { + strokeLinecap: "round", + transition: "stroke-dashoffset 0.3s ease", + }, +})); + +export const CustomCircularTimer: React.FC = ({ duration, remaining }) => { + const theme = useTheme(); + const progress = (remaining / duration) * 100; + + return ( + + {/* Серый фон */} + + + {/* Основной прогресс */} + + + + + + + + + + + + {/* Центральный контент */} + + + {remaining} + + + + ); +};