Add validation to background field

This commit is contained in:
Maksim Eltyshev
2020-06-03 22:27:20 +05:00
parent 7811d60efb
commit f85d499bbf
10 changed files with 130 additions and 25 deletions
@@ -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) {