Skip to content

Commit

Permalink
Include destination workspace name in modal message
Browse files Browse the repository at this point in the history
  • Loading branch information
philmcmahon committed Jan 8, 2024
1 parent 4f6274a commit 740e127
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/src/js/components/workspace/CopyOrMoveModal.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';

type Props = {
destinationWorkspaceName: string
onSubmit: (action: "copy" | "move") => void
}
export const CopyOrMoveModal = ({onSubmit}: Props) => {
export const CopyOrMoveModal = ({destinationWorkspaceName, onSubmit}: Props) => {

return (
<form className='form' >
<h2>Copy or move items</h2>
Do you want to copy or move the selected items to the destination workspace?
Do you want to copy or move the selected items to the workspace '{destinationWorkspaceName}'?

<div className='modal-action__buttons'>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const WorkspacesSidebarItem: FC<PropTypes> = ({selectedEntries, moveItems, copyI
<div className='sidebar__item__text'>{linkedToWorkspaceName}</div>
</SidebarSearchLink>
<Modal isOpen={copyOrMoveModalOpen} dismiss={() => setCopyOrMoveModalOpen(false)}>
<CopyOrMoveModal onSubmit={(action: "copy" | "move") => {
<CopyOrMoveModal destinationWorkspaceName={linkedToWorkspaceName} onSubmit={(action: "copy" | "move") => {
const actionFn = action === "copy" ? copyItems : moveItems
actionFn(selectedWorkspaceId, entryIds, linkedToWorkspaceId)
setCopyOrMoveModalOpen(false)
Expand Down

0 comments on commit 740e127

Please sign in to comment.