feat: images clickable
This commit is contained in:
parent
e2adbbb25e
commit
5fa7259e09
@ -60,9 +60,22 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
|||||||
<Box
|
<Box
|
||||||
key={index}
|
key={index}
|
||||||
sx={{
|
sx={{
|
||||||
|
cursor: "pointer",
|
||||||
borderRadius: "5px",
|
borderRadius: "5px",
|
||||||
border: `1px solid ${theme.palette.grey2.main}`,
|
border: `1px solid ${theme.palette.grey2.main}`,
|
||||||
}}
|
}}
|
||||||
|
onClick={(event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
updateAnswer(
|
||||||
|
currentQuestion.content.id,
|
||||||
|
currentQuestion.content.variants[index].id
|
||||||
|
);
|
||||||
|
|
||||||
|
if (answer === currentQuestion.content.variants[index].id) {
|
||||||
|
deleteAnswer(currentQuestion.content.id);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Box sx={{ display: "flex", alignItems: "center", gap: "10px" }}>
|
<Box sx={{ display: "flex", alignItems: "center", gap: "10px" }}>
|
||||||
<Box sx={{ width: "100%", height: "300px" }}>
|
<Box sx={{ width: "100%", height: "300px" }}>
|
||||||
@ -88,18 +101,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
|||||||
color: theme.palette.grey2.main,
|
color: theme.palette.grey2.main,
|
||||||
marginTop: "10px",
|
marginTop: "10px",
|
||||||
}}
|
}}
|
||||||
onClick={(event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
updateAnswer(
|
|
||||||
currentQuestion.content.id,
|
|
||||||
currentQuestion.content.variants[index].id
|
|
||||||
);
|
|
||||||
|
|
||||||
if (answer === currentQuestion.content.variants[index].id) {
|
|
||||||
deleteAnswer(currentQuestion.content.id);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
value={index}
|
value={index}
|
||||||
control={
|
control={
|
||||||
<Radio checkedIcon={<RadioCheck />} icon={<RadioIcon />} />
|
<Radio checkedIcon={<RadioCheck />} icon={<RadioIcon />} />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user