Add validation to background field

This commit is contained in:
Maksim Eltyshev
2020-06-03 22:27:20 +05:00
parent ab83d7c9ab
commit 99d9ab4a9e
10 changed files with 130 additions and 25 deletions

View File

@@ -54,17 +54,10 @@ const ActionsStep = React.memo(
);
const handleBackgroundImageDelete = useCallback(() => {
const data = {
onUpdate({
backgroundImage: null,
};
// TODO: move to services?
if (project.background && project.background.type === 'image') {
data.background = null;
}
onUpdate(data);
}, [project.background, onUpdate]);
});
}, [onUpdate]);
if (step) {
if (step) {