diff --git a/.changeset/rich-flowers-decide.md b/.changeset/rich-flowers-decide.md new file mode 100644 index 0000000000..ef67d6df88 --- /dev/null +++ b/.changeset/rich-flowers-decide.md @@ -0,0 +1,6 @@ +--- +"@medusajs/admin-ui": patch +"@medusajs/medusa": patch +--- + +fix(admin-ui, medusa): Minor ui fixes relating to stock locations diff --git a/packages/admin-ui/ui/src/components/organisms/delete-prompt.tsx b/packages/admin-ui/ui/src/components/organisms/delete-prompt.tsx index c0349fa142..f743e3824c 100644 --- a/packages/admin-ui/ui/src/components/organisms/delete-prompt.tsx +++ b/packages/admin-ui/ui/src/components/organisms/delete-prompt.tsx @@ -1,8 +1,9 @@ import React, { useState } from "react" -import useNotification from "../../hooks/use-notification" -import { getErrorMessage } from "../../utils/error-messages" + import Button from "../fundamentals/button" import Modal from "../molecules/modal" +import { getErrorMessage } from "../../utils/error-messages" +import useNotification from "../../hooks/use-notification" type DeletePromptProps = { heading?: string @@ -31,7 +32,11 @@ const DeletePrompt: React.FC = ({ setIsLoading(true) onDelete() - .then(() => notification("Success", successText, "success")) + .then(() => { + if (successText) { + notification("Success", successText, "success") + } + }) .catch((err) => notification("Error", getErrorMessage(err), "error")) .finally(() => { setIsLoading(false) @@ -45,14 +50,14 @@ const DeletePrompt: React.FC = ({
{heading} - {text} + {text}
-
+
+ {isShowingClosePrompt && ( + onClose()} + /> + )}