--
This commit is contained in:
parent
c5e931702b
commit
87f78ff8cf
@ -4,6 +4,7 @@ run-name: ${{ gitea.actor }} build image and push to container registry
|
|||||||
on:
|
on:
|
||||||
registry_package:
|
registry_package:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
package_name: "squiz/frontanswerer/main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# CreateImage:
|
# CreateImage:
|
||||||
|
|||||||
@ -62,7 +62,13 @@ export function useQuizData(quizId: string, preview: boolean = false) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
addQuestions(data.questions.slice(1));
|
addQuestions(data.questions.slice(1));
|
||||||
return data;
|
|
||||||
|
// Возвращаем полную структуру данных с настройками из store
|
||||||
|
const currentState = useQuizStore.getState();
|
||||||
|
return {
|
||||||
|
...currentState,
|
||||||
|
questions: [...currentState.questions, ...data.questions.slice(1)],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentPage >= questions.length) {
|
if (currentPage >= questions.length) {
|
||||||
|
|||||||
@ -177,6 +177,23 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// Функция валидации телефона
|
||||||
|
const validatePhone = (phoneValue: string) => {
|
||||||
|
// Если номер не пустой и не полный (меньше 10 символов) - это ошибка
|
||||||
|
if (phoneValue.length > 0 && phoneValue.length < 10) {
|
||||||
|
return t("Please complete the phone number");
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
// Проверяем валидность телефона при каждом изменении
|
||||||
|
const isPhoneValid = phone.length === 0 || phone.length >= 10;
|
||||||
|
|
||||||
|
// Обработчик изменения телефона
|
||||||
|
const handlePhoneChange = (newPhone: string) => {
|
||||||
|
setPhone(newPhone);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
|||||||
@ -13,6 +13,6 @@ const isProduction = !(
|
|||||||
|
|
||||||
//туризм больше не в исключениях
|
//туризм больше не в исключениях
|
||||||
if (!isProduction) domain = "https://s.hbpn.link";
|
if (!isProduction) domain = "https://s.hbpn.link";
|
||||||
domain = "https://hbpn.link";
|
// domain = "https://hbpn.link";
|
||||||
|
|
||||||
export { domain, isProduction };
|
export { domain, isProduction };
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"cypress:open": "cypress open",
|
"cypress:open": "cypress open",
|
||||||
"prepublishOnly": "npm run build:package",
|
"prepublishOnly": "npm run build:package",
|
||||||
|
"deploy": "docker login gitea.pena && docker build -t gitea.pena/squiz/frontanswerer/main:latest . && docker push gitea.pena/squiz/frontanswerer/main:latest",
|
||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -67,9 +67,13 @@ const r = {
|
|||||||
"Get results": "Получить результаты",
|
"Get results": "Получить результаты",
|
||||||
"Data sent successfully": "Данные успешно отправлены",
|
"Data sent successfully": "Данные успешно отправлены",
|
||||||
Step: "Шаг",
|
Step: "Шаг",
|
||||||
"questions are not ready yet": "Вопросы для аудитории ещё не созданы. Пожалуйста, подождите",
|
of: "из",
|
||||||
|
Prev: "Пред",
|
||||||
|
Next: "След",
|
||||||
|
"questions are not ready yet": "Вопросы для аудитории пока не готовы. Подождите",
|
||||||
"Add your image": "Добавьте своё изображение",
|
"Add your image": "Добавьте своё изображение",
|
||||||
"select emoji": "выберите смайлик",
|
"select emoji": "выберите смайлик",
|
||||||
|
"Please complete the phone number": "Пожалуйста, заполните номер телефона до конца",
|
||||||
"": "", // Пустой ключ для fallback
|
"": "", // Пустой ключ для fallback
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
@ -131,6 +135,7 @@ const r = {
|
|||||||
"questions are not ready yet": "There are no questions for the audience yet. Please wait",
|
"questions are not ready yet": "There are no questions for the audience yet. Please wait",
|
||||||
"Add your image": "Add your image",
|
"Add your image": "Add your image",
|
||||||
"select emoji": "select emoji",
|
"select emoji": "select emoji",
|
||||||
|
"Please complete the phone number": "Please complete the phone number",
|
||||||
"": "", // Пустой ключ для fallback
|
"": "", // Пустой ключ для fallback
|
||||||
},
|
},
|
||||||
uz: {
|
uz: {
|
||||||
@ -192,6 +197,7 @@ const r = {
|
|||||||
"questions are not ready yet": "Tomoshabinlar uchun hozircha savollar yo'q. Iltimos kuting",
|
"questions are not ready yet": "Tomoshabinlar uchun hozircha savollar yo'q. Iltimos kuting",
|
||||||
"Add your image": "Rasmingizni qo'shing",
|
"Add your image": "Rasmingizni qo'shing",
|
||||||
"select emoji": "emoji tanlang",
|
"select emoji": "emoji tanlang",
|
||||||
|
"Please complete the phone number": "Iltimos, telefon raqamini to'liq kiriting",
|
||||||
"": "", // Пустой ключ для fallback
|
"": "", // Пустой ключ для fallback
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -235,6 +241,11 @@ i18n
|
|||||||
console.log("Available keys for ru:", Object.keys(r.ru));
|
console.log("Available keys for ru:", Object.keys(r.ru));
|
||||||
console.log("Available keys for en:", Object.keys(r.en));
|
console.log("Available keys for en:", Object.keys(r.en));
|
||||||
console.log("Available keys for uz:", Object.keys(r.uz));
|
console.log("Available keys for uz:", Object.keys(r.uz));
|
||||||
|
console.log("Looking for keys: Step, of, Prev, Next");
|
||||||
|
console.log("Step in ru:", r.ru.Step);
|
||||||
|
console.log("of in ru:", r.ru.of);
|
||||||
|
console.log("Prev in ru:", r.ru.Prev);
|
||||||
|
console.log("Next in ru:", r.ru.Next);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 4. Логирование событий
|
// 4. Логирование событий
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export default function QuizPopup({
|
|||||||
|
|
||||||
if (!quizData) return null;
|
if (!quizData) return null;
|
||||||
|
|
||||||
const isQuizCompleted = quizData.settings.cfg.antifraud ? quizData.recentlyCompleted : false;
|
const isQuizCompleted = quizData.settings?.cfg?.antifraud ? quizData.recentlyCompleted : false;
|
||||||
if (isQuizCompleted) return null;
|
if (isQuizCompleted) return null;
|
||||||
if (hideOnMobile && isMobile) return null;
|
if (hideOnMobile && isMobile) return null;
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export default function QuizSideButton({
|
|||||||
if (hideOnMobile && isMobile) return null;
|
if (hideOnMobile && isMobile) return null;
|
||||||
if (!quizData) return null;
|
if (!quizData) return null;
|
||||||
|
|
||||||
const isQuizCompleted = quizData.settings.cfg.antifraud ? quizData.recentlyCompleted : false;
|
const isQuizCompleted = quizData.settings?.cfg?.antifraud ? quizData.recentlyCompleted : false;
|
||||||
const showButtonFlash = !isQuizCompleted && isFlashEnabled;
|
const showButtonFlash = !isQuizCompleted && isFlashEnabled;
|
||||||
|
|
||||||
return createPortal(
|
return createPortal(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user