fix layout and gradients

This commit is contained in:
nflnkr 2024-04-09 22:52:45 +03:00
parent 2830d93f13
commit 49476e328e
4 changed files with 77 additions and 78 deletions

@ -17,15 +17,15 @@ import {
import CustomCheckbox from "@ui_kit/CustomCheckbox";
import { FC, useRef, useState } from "react";
import { DESIGN_LIST } from "@/utils/designList";
import { sendFC } from "@api/quizRelase";
import { useQuizData } from "@contexts/QuizDataContext";
import { NameplateLogo } from "@icons/NameplateLogo";
import { QuizQuestionResult } from "@model/questionTypes/result";
import { AnyTypedQuizQuestion } from "@model/questionTypes/shared";
import { quizThemes } from "@utils/themes/Publication/themePublication";
import { enqueueSnackbar } from "notistack";
import { useRootContainerSize } from "../../contexts/RootContainerWidthContext";
import {useQuizData} from "@contexts/QuizDataContext";
import { DESIGN_LIST } from "@/utils/designList";
const TextField = MuiTextField as unknown as FC<TextFieldProps>; // temporary fix ts(2590)
@ -68,7 +68,7 @@ export const ContactForm = ({currentQuestion, onShowResult}: Props) => {
});
if (!resultQuestion) throw new Error("Result question not found");
console.log("yfcnhjqrb", settings.cfg.resultInfo.showResultForm)
const inputHC = async () => {
const FC = settings.cfg.formContact.fields || settings.cfg.formContact;
const body = {} as any;
@ -110,7 +110,7 @@ export const ContactForm = ({currentQuestion, onShowResult}: Props) => {
const isWide = Object.keys(filteredFC).length > 2;
async function handleShowResultsClick() {
const FC: any = settings.cfg.formContact.fields
const FC: any = settings.cfg.formContact.fields;
if (FC["email"].used !== EMAIL_REGEXP.test(email)) {
return enqueueSnackbar("введена некорректная почта");
}
@ -170,7 +170,9 @@ export const ContactForm = ({currentQuestion, onShowResult}: Props) => {
backgroundPosition: "center",
backgroundSize: "cover",
backgroundImage: settings.cfg.design && !isMobile
? quizThemes[settings.cfg.theme].isLight
? `url(${DESIGN_LIST[settings.cfg.theme]})`
: `linear-gradient(90deg, #272626, transparent), url(${DESIGN_LIST[settings.cfg.theme]})`
: null,
}}
>
@ -181,11 +183,7 @@ export const ContactForm = ({currentQuestion, onShowResult}: Props) => {
height: "100%",
minHeight: "100%",
display: isWide && !isMobile ? "flex" : undefined,
background: settings.cfg.design && !isMobile
? quizThemes[settings.cfg.theme].isLight
? "transparent"
: "linear-gradient(90deg,#272626, transparent)"
: theme.palette.background.default,
background: settings.cfg.design && !isMobile ? undefined : theme.palette.background.default,
}}
>
<Box
@ -378,7 +376,7 @@ const Inputs = ({
const FC = settings.cfg.formContact.fields;
if (!FC) return null;
console.log(email)
console.log(email);
const Name = (
<CustomInput
onChange={({ target }) => setName(target.value)}
@ -450,7 +448,7 @@ const CustomInput = ({title, desc, Icon, onChange, id}: {
id: string;
title: string;
desc: string;
Icon: FC<{ color: string; backgroundColor: string }>;
Icon: FC<{ color: string; backgroundColor: string; }>;
onChange: TextFieldProps["onChange"];
}) => {
const theme = useTheme();

@ -38,7 +38,6 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => {
height: "100%",
minHeight: "100%",
width: "100%",
overflow: "auto",
backgroundColor: theme.palette.background.default,
backgroundPosition: "center",
backgroundSize: "cover",
@ -55,8 +54,9 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => {
justifyContent: "space-between",
alignItems: "center",
pt: "30px",
width: "inherit",
height: "inherit",
width: "100%",
height: "100%",
overflow: "auto",
background: settings.cfg.design && !isMobile
? quizThemes[settings.cfg.theme].isLight
? "transparent"

@ -55,6 +55,7 @@ const StandartLayout = ({
justifyContent: "space-between",
alignItems: "flex-start",
p: "25px",
overflowY: "auto",
background:
settings.cfg.design && !quizThemes[settings.cfg.theme].isLight
? "linear-gradient(90deg,#272626,transparent)"

@ -1,6 +1,6 @@
{
"name": "@frontend/squzanswerer",
"version": "1.0.22",
"version": "1.0.23",
"type": "module",
"main": "./dist-package/index.js",
"module": "./dist-package/index.js",