From 4ea08f12605892d53b8616b0abf1d5bc46992d04 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Thu, 18 Apr 2024 06:25:43 +0500 Subject: [PATCH] fix(next-button-active): next button active even when type is not selected --- .../AddItemModal/SetAttributesStep/index.tsx | 10 ++++++++-- src/components/AddItemModal/index.tsx | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/AddItemModal/SetAttributesStep/index.tsx b/src/components/AddItemModal/SetAttributesStep/index.tsx index 77f274c71..e475736f6 100644 --- a/src/components/AddItemModal/SetAttributesStep/index.tsx +++ b/src/components/AddItemModal/SetAttributesStep/index.tsx @@ -15,9 +15,10 @@ import { requiredRule } from '~/constants' type Props = { skipToStep: (step: AddItemModalStepID) => void nodeType: string + handleSelectType: (val: string) => void } -export const SetAttributesStep: FC = ({ skipToStep, nodeType }) => { +export const SetAttributesStep: FC = ({ handleSelectType, skipToStep, nodeType }) => { const [loading, setLoading] = useState(false) const [attributes, setAttributes] = useState() @@ -58,6 +59,11 @@ export const SetAttributesStep: FC = ({ skipToStep, nodeType }) => { }) : [] + const handlePrevButton = () => { + handleSelectType('') + skipToStep('sourceType') + } + return ( @@ -94,7 +100,7 @@ export const SetAttributesStep: FC = ({ skipToStep, nodeType }) => { - diff --git a/src/components/AddItemModal/index.tsx b/src/components/AddItemModal/index.tsx index 1602a5148..759572d1d 100644 --- a/src/components/AddItemModal/index.tsx +++ b/src/components/AddItemModal/index.tsx @@ -235,7 +235,7 @@ export const AddItemModal = () => { source: , setBudget: null} />, createConfirmation: , - setAttribues: , + setAttribues: , } const modalKind: ModalKind = 'small'