From b1c3ab731434005538cdd1033550a49b3810c638 Mon Sep 17 00:00:00 2001 From: Nastya Date: Sat, 9 Aug 2025 23:57:33 +0300 Subject: [PATCH] fix inntr quiz id param --- .../ContactForm/CustomInput/CustomInput.tsx | 18 +++++++++++++++++- lib/model/api/getQuizData.ts | 3 ++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/components/ViewPublicationPage/ContactForm/CustomInput/CustomInput.tsx b/lib/components/ViewPublicationPage/ContactForm/CustomInput/CustomInput.tsx index 6d5cb6a..e231ffd 100644 --- a/lib/components/ViewPublicationPage/ContactForm/CustomInput/CustomInput.tsx +++ b/lib/components/ViewPublicationPage/ContactForm/CustomInput/CustomInput.tsx @@ -17,6 +17,8 @@ type InputProps = { isPhone?: boolean; type?: HTMLInputTypeAttribute; value?: string; + onBlur?: () => void; + error?: string; }; const TextField = MuiTextField as unknown as FC; @@ -34,7 +36,18 @@ function phoneChange(e: ChangeEvent, mask: string) { return a || ""; } -export const CustomInput = ({ title, desc, Icon, onChange, onChangePhone, isPhone, type, value }: InputProps) => { +export const CustomInput = ({ + title, + desc, + Icon, + onChange, + onChangePhone, + isPhone, + type, + value, + onBlur, + error, +}: InputProps) => { const theme = useTheme(); const isMobile = useRootContainerSize() < 600; const { settings } = useQuizStore(); @@ -57,8 +70,11 @@ export const CustomInput = ({ title, desc, Icon, onChange, onChangePhone, isPhon onChange={(e: ChangeEvent) => isPhone ? onChangePhone?.(phoneChange(e, mask)) : onChange?.(e) } + onBlur={onBlur} type={isPhone ? "tel" : type} value={value} + error={!!error} + helperText={error} sx={{ width: isMobile ? "100%" : "390px", backgroundColor: theme.palette.background.default, diff --git a/lib/model/api/getQuizData.ts b/lib/model/api/getQuizData.ts index 5ebf629..20e23a3 100644 --- a/lib/model/api/getQuizData.ts +++ b/lib/model/api/getQuizData.ts @@ -51,7 +51,8 @@ export function parseQuizData(quizDataResponse: GetQuizDataResponse): Omit