Skip to content

Commit

Permalink
fix: dest last item
Browse files Browse the repository at this point in the history
  • Loading branch information
BenElferink committed Feb 9, 2025
1 parent b767688 commit af493b6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
1 change: 1 addition & 0 deletions src/containers/destination-drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const DestinationDrawer: FC<DestinationDrawerProps> = ({
onSave={handleSave}
onDelete={handleDelete}
onCancel={handleCancel}
isLastItem={destinations.length === 1}
>
{isEditing ? (
<FormContainer>
Expand Down
14 changes: 0 additions & 14 deletions src/helpers/components/overview-drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,11 @@ const OverviewDrawer: React.FC<OverviewDrawerProps> = ({

useKeyDown({ key: 'Enter', active: isEdit }, () => clickSave())

// const { sources } = useSourceCRUD()
// const { destinations } = useDestinationCRUD()

const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false)
const [isCancelModalOpen, setIsCancelModalOpen] = useState(false)

const titleRef = useRef<EditTitleRef>(null)

const isSource = drawerType === ENTITY_TYPES.SOURCE
const isDestination = drawerType === ENTITY_TYPES.DESTINATION

const closeDrawer = () => {
setDrawerType(null)
Expand Down Expand Up @@ -99,15 +94,6 @@ const OverviewDrawer: React.FC<OverviewDrawerProps> = ({
if (onSave) onSave(titleRef.current?.getTitle() || '')
}

// const isLastItem = () => {
// let isLast = false

// if (isSource) isLast = sources.length === 1
// if (isDestination) isLast = destinations.length === 1

// return isLast
// }

const isPending = useMemo(() => {
if (!drawerType) return false

Expand Down

0 comments on commit af493b6

Please sign in to comment.