banner and button widget task icons use text color

This commit is contained in:
nflnkr 2024-06-08 17:09:22 +03:00
parent 4332bc0fe5
commit cc4c74329a
7 changed files with 82 additions and 21 deletions

@ -109,6 +109,6 @@
"bracketSpacing": true,
"arrowParens": "always",
"jsxSingleQuote": false,
"singleAttributePerLine": false
"singleAttributePerLine": true
}
}

@ -114,6 +114,7 @@ export default function BannerWidgetPreviewDesktop({
height: "calc(18.57 / 29.5 * 100%)",
ml: "calc(7.36 / 196 * 100%)",
aspectRatio: 1,
color: buttonTextColor,
}}
/>
<Box
@ -123,10 +124,16 @@ export default function BannerWidgetPreviewDesktop({
color: buttonTextColor,
}}
>
<Typography fontSize="calc(6 / 29.5 * 100cqh)" lineHeight="120%">
<Typography
fontSize="calc(6 / 29.5 * 100cqh)"
lineHeight="120%"
>
{appealText || "Пройти тест"}
</Typography>
<Typography fontSize="calc(11 / 29.5 * 100cqh)" lineHeight="120%">
<Typography
fontSize="calc(11 / 29.5 * 100cqh)"
lineHeight="120%"
>
{quizHeaderText || "Заголовок теста"}
</Typography>
</Box>

@ -87,6 +87,7 @@ export default function BannerWidgetPreviewMobile({
height: "calc(18.57 / 29.5 * 100%)",
ml: "calc(7.36 / 196 * 100%)",
aspectRatio: 1,
color: buttonTextColor,
}}
/>
<Box
@ -96,10 +97,16 @@ export default function BannerWidgetPreviewMobile({
color: buttonTextColor,
}}
>
<Typography fontSize="calc(6 / 29.5 * 100cqh)" lineHeight="120%">
<Typography
fontSize="calc(6 / 29.5 * 100cqh)"
lineHeight="120%"
>
{appealText || "Пройти тест"}
</Typography>
<Typography fontSize="calc(11 / 29.5 * 100cqh)" lineHeight="120%">
<Typography
fontSize="calc(11 / 29.5 * 100cqh)"
lineHeight="120%"
>
{quizHeaderText || "Заголовок теста"}
</Typography>
</Box>

@ -56,9 +56,15 @@ export default function ButtonWidgetPreviewDesktop({
width: "auto",
height: "calc(18.57 / 29.5 * 100%)",
aspectRatio: 1,
color: buttonTextColor,
}}
/>
<Typography fontSize="calc(3cqh)" lineHeight="120%" ml="3px" color={buttonTextColor}>
<Typography
fontSize="calc(3cqh)"
lineHeight="120%"
ml="3px"
color={buttonTextColor}
>
{buttonText || "Пройти тест"}
</Typography>
{buttonFlash && <RunningStripe />}

@ -4,9 +4,10 @@ import { Box } from "@mui/material";
interface Props {
fixedSide: "left" | "right";
buttonBackgroundColor: string;
buttonTextColor: string;
}
export default function ButtonWidgetPreviewMobile({ buttonBackgroundColor, fixedSide }: Props) {
export default function ButtonWidgetPreviewMobile({ buttonBackgroundColor, fixedSide, buttonTextColor }: Props) {
return (
<Box
sx={[
@ -38,6 +39,7 @@ export default function ButtonWidgetPreviewMobile({ buttonBackgroundColor, fixed
width: "auto",
height: "calc(80%)",
aspectRatio: 1,
color: buttonTextColor,
}}
/>
</Box>

@ -215,7 +215,11 @@ export default function ButtonWidgetSetup({ step, nextButton }: Props) {
withShadow={withShadow}
/>
{!hideOnMobile && (
<ButtonWidgetPreviewMobile fixedSide={fixedSide} buttonBackgroundColor={buttonBackgroundColor} />
<ButtonWidgetPreviewMobile
fixedSide={fixedSide}
buttonBackgroundColor={buttonBackgroundColor}
buttonTextColor={buttonTextColor}
/>
)}
</Box>
</Box>
@ -230,7 +234,10 @@ export default function ButtonWidgetSetup({ step, nextButton }: Props) {
flex: "1 1 0",
}}
>
<Typography fontWeight={500} color="#4D4D4D">
<Typography
fontWeight={500}
color="#4D4D4D"
>
1. Задайте размеры окна квиза (опционально)
</Typography>
<CustomCheckbox
@ -270,7 +277,10 @@ export default function ButtonWidgetSetup({ step, nextButton }: Props) {
alignItems: "start",
}}
>
<Typography fontWeight={500} color="#4D4D4D">
<Typography
fontWeight={500}
color="#4D4D4D"
>
2. Конструктор кнопки
</Typography>
<Box
@ -281,17 +291,31 @@ export default function ButtonWidgetSetup({ step, nextButton }: Props) {
}}
>
<Typography sx={{ color: theme.palette.grey2.main }}>Цвет кнопки</Typography>
<CircleColorPicker color={buttonBackgroundColor} onChange={(color) => setButtonBackgroundColor(color)} />
<CircleColorPicker
color={buttonBackgroundColor}
onChange={(color) => setButtonBackgroundColor(color)}
/>
<Typography sx={{ color: theme.palette.grey2.main }}>Цвет текста кнопки</Typography>
<CircleColorPicker color={buttonTextColor} onChange={(color) => setButtonTextColor(color)} />
<CircleColorPicker
color={buttonTextColor}
onChange={(color) => setButtonTextColor(color)}
/>
</Box>
<CustomCheckbox
label="Отключить на мобильных устройствах"
checked={hideOnMobile}
handleChange={(e) => setHideOnMobile(e.target.checked)}
/>
<CustomCheckbox label="Закругленная" checked={rounded} handleChange={(e) => setRounded(e.target.checked)} />
<CustomCheckbox label="С тенью" checked={withShadow} handleChange={(e) => setWithShadow(e.target.checked)} />
<CustomCheckbox
label="Закругленная"
checked={rounded}
handleChange={(e) => setRounded(e.target.checked)}
/>
<CustomCheckbox
label="С тенью"
checked={withShadow}
handleChange={(e) => setWithShadow(e.target.checked)}
/>
<CustomCheckbox
label="С бликом"
checked={buttonFlash}
@ -317,7 +341,12 @@ export default function ButtonWidgetSetup({ step, nextButton }: Props) {
>
<FormControlLabel
value="left"
control={<Radio checkedIcon={<RadioCheck />} icon={<RadioIcon />} />}
control={
<Radio
checkedIcon={<RadioCheck />}
icon={<RadioIcon />}
/>
}
label="Слева"
sx={{
color: theme.palette.grey2.main,
@ -325,7 +354,12 @@ export default function ButtonWidgetSetup({ step, nextButton }: Props) {
/>
<FormControlLabel
value="right"
control={<Radio checkedIcon={<RadioCheck />} icon={<RadioIcon />} />}
control={
<Radio
checkedIcon={<RadioCheck />}
icon={<RadioIcon />}
/>
}
label="Справа"
sx={{
color: theme.palette.grey2.main,

@ -13,6 +13,7 @@ export default function TaskIcon({ sx = [] }: Props) {
alignItems: "center",
justifyContent: "center",
flexShrink: 0,
color: "white",
"& svg": {
width: "100%",
height: "100%",
@ -21,31 +22,35 @@ export default function TaskIcon({ sx = [] }: Props) {
...(Array.isArray(sx) ? sx : [sx]),
]}
>
<svg viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg
viewBox="0 0 20 19"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M13.2979 2.94922H15.4949C15.6488 2.94922 15.7964 3.01036 15.9052 3.11919C16.0141 3.22802 16.0752 3.37563 16.0752 3.52954V6.77848M7.21163 2.94922H5.04907C4.89516 2.94922 4.74755 3.01036 4.63872 3.11919C4.52989 3.22802 4.46875 3.37563 4.46875 3.52954V15.7163C4.46875 15.8702 4.52989 16.0178 4.63872 16.1267C4.74755 16.2355 4.89516 16.2966 5.04907 16.2966H8.53802M7.95068 16.2966H15.4949C15.6488 16.2966 15.7964 16.2355 15.9052 16.1267C16.0141 16.0178 16.0752 15.8702 16.0752 15.7163V11.9923"
stroke="white"
stroke="currentColor"
strokeWidth="0.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M9.40182 13.7891H7.65735C7.58039 13.7891 7.50659 13.762 7.45217 13.7139C7.39776 13.6659 7.36719 13.6006 7.36719 13.5326V8.14708C7.36719 8.07906 7.39776 8.01383 7.45217 7.96574C7.50659 7.91764 7.58039 7.89062 7.65735 7.89062H9.10815H12.8802C12.9572 7.89062 13.031 7.91764 13.0854 7.96574C13.1398 8.01383 13.1704 8.07906 13.1704 8.14708V9.58283"
stroke="white"
stroke="currentColor"
strokeWidth="0.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M7.36719 1.8125H13.1704V3.39705C13.1704 3.71756 12.9106 3.97737 12.5901 3.97737H7.94751C7.62701 3.97737 7.36719 3.71756 7.36719 3.39705V1.8125Z"
stroke="white"
stroke="currentColor"
strokeWidth="0.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M17.0844 8.36719L11.8615 13.5901L9.25 10.9786"
stroke="white"
stroke="currentColor"
strokeWidth="0.5"
strokeLinecap="round"
strokeLinejoin="round"