крестик показывается в Images только когда загружена картинки
This commit is contained in:
parent
6f1e34a814
commit
f274070c60
@ -85,7 +85,13 @@ export const OwnImage = ({ imageUrl, questionId, variantId, onValidationError }:
|
||||
const handleRemoveImage = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
setSelectedFile(null);
|
||||
updateOwnVariant(variantId, "", "", "", "");
|
||||
updateOwnVariant(variantId, ownVariantData?.variant.answer || "", "", "", "");
|
||||
/*
|
||||
1 - answer - письменный ответ
|
||||
2 - extendedText - строка используется в эмодзи-вопросах для хранения выбранного эмодзи
|
||||
3 - originalImageUrl - полный URL изображения, загруженного на сервер
|
||||
4 - localImageUrl - временный URL для отображения изображения в браузере
|
||||
*/
|
||||
};
|
||||
|
||||
// Определяем, что показывать
|
||||
@ -152,6 +158,7 @@ export const OwnImage = ({ imageUrl, questionId, variantId, onValidationError }:
|
||||
color: "white",
|
||||
height: "25px",
|
||||
width: "25px",
|
||||
display: selectedFile ? "inherit" : "none",
|
||||
"&:hover": {
|
||||
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
||||
},
|
||||
|
@ -115,13 +115,13 @@ export const createQuizViewStore = () =>
|
||||
});
|
||||
} else {
|
||||
state.ownVariants[index].variant.answer = answer;
|
||||
if (extendedText) {
|
||||
if (extendedText !== undefined) {
|
||||
state.ownVariants[index].variant.extendedText = extendedText;
|
||||
}
|
||||
if (originalImageUrl) {
|
||||
if (originalImageUrl !== undefined) {
|
||||
state.ownVariants[index].variant.originalImageUrl = originalImageUrl;
|
||||
}
|
||||
if (localImageUrl) {
|
||||
if (localImageUrl !== undefined) {
|
||||
state.ownVariants[index].variant.localImageUrl = localImageUrl;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user