Commit 3935464e by asranov0003

fix: manage modal app action variants

parent be9ddb83
......@@ -11,15 +11,21 @@ import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import CModal from "../../components/CModal";
import CButton from "../../components/CButton";
import { useAppDispatch, useAppSelector, type RootState } from "../../stores/store";
import {
useAppDispatch,
useAppSelector,
type RootState,
} from "../../stores/store";
import { blockDevice, unBlockDevice } from "../../stores/slices/commandSlice";
const ManageApps: React.FC = () => {
const [isOpenLockDeviceModal, setIsOpenLockDeviceModal] = useState(false);
const [isOpenUnLockDeviceModal, setIsOpenUnLockDeviceModal] = useState(false);
const { t } = useTranslation();
const { selectedDevice } = useAppSelector((state: RootState) => state.device)
const { isLoadingBlockDevice, isLoadingUnBlockDevice } = useAppSelector((state: RootState) => state.command)
const { selectedDevice } = useAppSelector((state: RootState) => state.device);
const { isLoadingBlockDevice, isLoadingUnBlockDevice } = useAppSelector(
(state: RootState) => state.command
);
const dispatch = useAppDispatch();
const handleModalLockDevice = () => {
......@@ -38,7 +44,7 @@ const ManageApps: React.FC = () => {
} finally {
handleModalLockDevice();
}
}
};
const handleUnBlockDevice = async () => {
try {
......@@ -103,14 +109,11 @@ const ManageApps: React.FC = () => {
</p>
<div className="manageapps__modal__actions">
<CButton title={t("common.no")} onClick={handleModalLockDevice} />
<CButton
title={t("common.no")}
title={t("common.yes")}
variant="danger"
onClick={handleModalLockDevice}
/>
<CButton
title={t("common.yes")}
onClick={handleBlockDevice}
onClick={handleBlockDevice}
isLoading={isLoadingBlockDevice}
/>
</div>
......@@ -133,11 +136,11 @@ const ManageApps: React.FC = () => {
<div className="manageapps__modal__actions">
<CButton
title={t("common.no")}
variant="danger"
onClick={handleModalUnlockDevice}
/>
<CButton
<CButton
title={t("common.yes")}
variant="danger"
onClick={handleUnBlockDevice}
isLoading={isLoadingUnBlockDevice}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment