2023-05-03 19:21:00 +00:00
import {
Box ,
FormControl ,
FormControlLabel ,
Link ,
Radio ,
RadioGroup ,
TextField ,
Typography ,
useTheme
} from "@mui/material" ;
import InstallQzOnSiteParent from "./InstallQzOnSiteParent" ;
2023-05-07 14:01:03 +00:00
import React , { useState } from "react" ;
2023-05-03 19:21:00 +00:00
import BannerImg from "../../assets/BannerImg.png"
import CustomTextField from "@ui_kit/CustomTextField" ;
import CustomCheckbox from "@ui_kit/CustomCheckbox" ;
2023-05-03 23:25:35 +00:00
import RadioCheck from "@ui_kit/RadioCheck" ;
import RadioIcon from "@ui_kit/RadioIcon" ;
2023-05-07 14:01:03 +00:00
import AccordMy from "@ui_kit/Accordion" ;
2023-05-03 19:21:00 +00:00
2023-05-07 14:01:03 +00:00
type isExpanded = "panel1" | "panel2"
2023-05-03 19:21:00 +00:00
export default function BannerInstall ( ) {
const theme = useTheme ( ) ;
const [ value , setValue ] = React . useState ( "1" ) ;
const handleChangeRadio = ( event : React.ChangeEvent < HTMLInputElement > ) = > {
setValue ( ( event . target as HTMLInputElement ) . value ) ;
} ;
const [ value2 , setValue2 ] = React . useState ( "1" ) ;
const handleChangeRadio2 = ( event : React.ChangeEvent < HTMLInputElement > ) = > {
setValue2 ( ( event . target as HTMLInputElement ) . value ) ;
} ;
2023-05-07 14:01:03 +00:00
const [ isExpanded , setIsExpanded ] = useState < isExpanded > ( "panel1" ) ;
2023-05-03 19:21:00 +00:00
return (
< InstallQzOnSiteParent >
{ /*левая часть*/ }
< Box sx = { { maxWidth : '560px' } } >
< img src = { BannerImg } / >
< Typography sx = { { fontSize : '14px' , color : theme.palette.grey2.main } } >
Е с л и к в и з у ж е у с т а н о в л е н н а с а й т , и в ы ч т о - т о з д е с ь и з м е н и л и , к о д н а с а й т е н у ж н о б у д е т п о м е н я т ь .
Н а с т р о й к и в э т о м к о н с т р у к т о р е н е с о х р а н я ю т с я .
< / Typography >
< / Box >
{ /*правая часть*/ }
< Box sx = { { display : "flex" , flexDirection : "column" , } } >
< Box sx = { { display : "flex" , flexDirection : "column" , gap : "15px" } } >
< Typography sx = { { color : theme.palette.grey2.main } } > Т е к с т - п р и з ы в < / Typography >
< CustomTextField placeholder = { "Пройти тест" } / >
< Typography sx = { { color : theme.palette.grey2.main } } > З а г о л о в о к к в и з а < / Typography >
< CustomTextField placeholder = { "Заголовок квиза" } / >
< Box sx = { { display : "flex" , gap : "10px" , alignItems : "center" } } >
< Typography sx = { { color : theme.palette.grey2.main } } > П о к а з ы в а т ь ч е р е з < / Typography >
< FormControl
fullWidth
variant = "standard"
sx = { { p : 0 , width : "60px" , } }
>
< TextField
fullWidth
placeholder = "20"
sx = { {
"& .MuiInputBase-root" : {
backgroundColor : theme.palette.background.default ,
height : "48px" ,
width : "60px" ,
borderRadius : "10px" ,
} ,
} }
inputProps = { {
sx : {
borderRadius : "10px" ,
fontSize : "18px" ,
lineHeight : "21px" ,
py : 0 ,
}
} }
/ >
< / FormControl >
< Typography sx = { { color : theme.palette.grey2.main } } > с е к у н д < / Typography >
< / Box >
< Box
sx = { {
display : 'flex' ,
gap : '40px'
} }
>
< Typography sx = { { color : theme.palette.grey2.main } } > Ц в е т к н о п к и < / Typography >
< Box sx = { { width : "20px" , height : "20px" , borderRadius : "50%" , backgroundColor : theme.palette.brightPurple.main , border : "1px solid #4D4D4D" } } > < / Box >
< Typography sx = { { color : theme.palette.grey2.main } } > Ц в е т т е к с т а к н о п к и < / Typography >
< Box sx = { { width : "20px" , height : "20px" , borderRadius : "50%" , backgroundColor : "#ffffff" , border : "1px solid #4D4D4D" } } > < / Box >
< / Box >
< / Box >
2023-05-07 14:01:03 +00:00
< AccordMy header = { "Баннер сбоку экрана" } isExpanded = { isExpanded === "panel1" } onClick = { ( ) = > setIsExpanded ( "panel1" ) } sx = { { display : "flex" , flexDirection : 'column' , } } >
< Typography sx = { { color : theme.palette.grey2.main } } > Р а с п о л о ж е н и е < / Typography >
< FormControl >
2023-05-03 19:21:00 +00:00
2023-05-07 14:01:03 +00:00
< RadioGroup
aria - labelledby = "demo-controlled-radio-buttons-group"
name = "controlled-radio-buttons-group"
value = { value }
onChange = { handleChangeRadio }
sx = { { maxWidth : "380px" , display : "flex" , flexWrap : "wrap" , flexDirection : "row" , paddingLeft : "5px" , justifyContent : "space-between" } }
>
< Box sx = { { display : "flex" , flexDirection : "column" } } >
2023-05-03 19:21:00 +00:00
< FormControlLabel
sx = { { color : theme.palette.grey2.main } }
value = "1"
2023-05-03 23:25:35 +00:00
control = { < Radio checkedIcon = { < RadioCheck / > } icon = { < RadioIcon / > } / > }
2023-05-03 19:21:00 +00:00
label = "Слева сверху"
/ >
< FormControlLabel
sx = { { color : theme.palette.grey2.main } }
value = "2"
2023-05-03 23:25:35 +00:00
control = { < Radio checkedIcon = { < RadioCheck / > } icon = { < RadioIcon / > } / > }
2023-05-03 19:21:00 +00:00
label = "Справа сверху"
/ >
2023-05-07 14:01:03 +00:00
< / Box >
< Box sx = { { display : "flex" , flexDirection : "column" } } >
2023-05-03 19:21:00 +00:00
< FormControlLabel
sx = { { color : theme.palette.grey2.main } }
value = "3"
2023-05-03 23:25:35 +00:00
control = { < Radio checkedIcon = { < RadioCheck / > } icon = { < RadioIcon / > } / > }
2023-05-03 19:21:00 +00:00
label = "Слева снизу"
/ >
< FormControlLabel
sx = { { color : theme.palette.grey2.main } }
value = "4"
2023-05-03 23:25:35 +00:00
control = { < Radio checkedIcon = { < RadioCheck / > } icon = { < RadioIcon / > } / > }
2023-05-03 19:21:00 +00:00
label = "Справа снизу"
/ >
2023-05-07 14:01:03 +00:00
< / Box >
< / RadioGroup >
< / FormControl >
< Typography sx = { { color : theme.palette.grey2.main } } > П а р а м е т р ы < / Typography >
< CustomCheckbox label = { "Закругленная" } / >
< CustomCheckbox label = { "С тенью" } / >
< CustomCheckbox label = { "С бликом" } / >
< CustomCheckbox label = { 'Эффект "пульсация"' } / >
< CustomCheckbox label = { "Отключить на мобильных устройствах" } / >
< / AccordMy >
< AccordMy header = { "Баннер на всю ширину экрана" } isExpanded = { isExpanded === "panel2" } onClick = { ( ) = > setIsExpanded ( "panel2" ) } sx = { { display : "flex" , flexDirection : 'column' , } } >
< Typography sx = { { color : theme.palette.grey2.main } } > Р а с п о л о ж е н и е < / Typography >
< FormControl >
< RadioGroup
aria - labelledby = "demo-controlled-radio-buttons-group"
name = "controlled-radio-buttons-group"
value = { value2 }
onChange = { handleChangeRadio2 }
sx = { { maxWidth : "365px" , display : "flex" , flexWrap : "wrap" , flexDirection : "row" , paddingLeft : "5px" , } }
>
< FormControlLabel
sx = { { color : theme.palette.grey2.main } }
value = "1"
control = { < Radio checkedIcon = { < RadioCheck / > } icon = { < RadioIcon / > } / > }
label = "Сверху страницы"
/ >
< FormControlLabel
sx = { { color : theme.palette.grey2.main } }
value = "2"
control = { < Radio checkedIcon = { < RadioCheck / > } icon = { < RadioIcon / > } / > }
label = "Снизу страницы"
/ >
< / RadioGroup >
< / FormControl >
< Typography sx = { { color : theme.palette.grey2.main } } > П а р а м е т р ы < / Typography >
< CustomCheckbox label = { "С тенью" } / >
< CustomCheckbox label = { "С бликом" } / >
< CustomCheckbox label = { 'Эффект "пульсация"' } / >
< CustomCheckbox label = { "Отключить на мобильных устройствах" } / >
< / AccordMy >
2023-05-03 19:21:00 +00:00
< Link
component = 'button'
// onClick={}
sx = { {
fontSize : "16px" ,
lineHeight : "19px" ,
color : theme.palette.brightPurple.main ,
textDecorationColor : theme.palette.brightPurple.main ,
2023-05-07 14:01:03 +00:00
textAlign : 'left' ,
padding : "15px 0" ,
2023-05-03 19:21:00 +00:00
} } > + А в т о о т к р ы т и е к в и з а < / Link >
< / Box >
< / InstallQzOnSiteParent >
)
}