mirror of
https://github.com/hexastack/hexabot
synced 2025-04-24 00:04:17 +00:00
fix(frontend): add feedback updates
This commit is contained in:
parent
7a19ba67e5
commit
64707c5cf5
@ -13,18 +13,18 @@ import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
export const ConfirmDialogBody = ({
|
||||
mode = "click",
|
||||
itemsNumber = 1,
|
||||
count = 1,
|
||||
}: {
|
||||
mode?: "selection" | "click";
|
||||
itemsNumber?: number;
|
||||
count?: number;
|
||||
}) => {
|
||||
const { t } = useTranslate();
|
||||
const dialogBodyText =
|
||||
mode === "selection"
|
||||
? itemsNumber === 1
|
||||
? count === 1
|
||||
? t("message.item_selected_delete_confirm")
|
||||
: t("message.items_selected_delete_confirm", {
|
||||
"0": itemsNumber.toString(),
|
||||
"0": count.toString(),
|
||||
})
|
||||
: t("message.item_delete_confirm");
|
||||
|
||||
|
@ -52,7 +52,7 @@ export const CategoryForm: FC<ComponentFormProps<ICategory>> = ({
|
||||
required: t("message.label_is_required"),
|
||||
},
|
||||
};
|
||||
const onSubmitForm = async (params: ICategoryAttributes) => {
|
||||
const onSubmitForm = (params: ICategoryAttributes) => {
|
||||
if (data) {
|
||||
updateCategory({ id: data.id, params });
|
||||
} else {
|
||||
|
@ -163,7 +163,7 @@ export const Categories = () => {
|
||||
const isConfirmed = await dialogs.confirm(
|
||||
<ConfirmDialogBody
|
||||
mode="selection"
|
||||
itemsNumber={selectedCategories.length}
|
||||
count={selectedCategories.length}
|
||||
/>,
|
||||
);
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
import {
|
||||
createContext,
|
||||
FC,
|
||||
useCallback,
|
||||
useId,
|
||||
useMemo,
|
||||
@ -16,7 +15,6 @@ import {
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { ConfirmDialog, ConfirmDialogProps } from "@/app-components/dialogs";
|
||||
import {
|
||||
CloseDialog,
|
||||
DialogComponent,
|
||||
@ -30,7 +28,6 @@ export const DialogsContext = createContext<
|
||||
| {
|
||||
open: OpenDialog;
|
||||
close: CloseDialog;
|
||||
confirm: FC<ConfirmDialogProps>;
|
||||
}
|
||||
| undefined
|
||||
>(undefined);
|
||||
@ -124,7 +121,6 @@ function DialogsProvider(props: DialogProviderProps) {
|
||||
() => ({
|
||||
open: requestDialog,
|
||||
close: closeDialog,
|
||||
confirm: ConfirmDialog,
|
||||
}),
|
||||
[requestDialog, closeDialog],
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user