fixed DeleteProfileEver and DeleteUsersDialog + fixed ModalDialogComponent

This commit is contained in:
mushka 2022-07-04 13:20:18 +03:00
parent f88b82670a
commit 24c0397ef0
7 changed files with 23 additions and 25 deletions

View File

@ -1,4 +1,15 @@
import { getCurrentSizeName } from "../../utils/device";
import { size } from "../../utils/device";
const getCurrentSizeName = () => {
const innerWidth = window.innerWidth;
return innerWidth > size.tablet
? "desktop"
: innerWidth <= size.tablet && innerWidth > size.smallTablet
? "tablet"
: innerWidth <= size.smallTablet && innerWidth > size.mobile
? "smallTablet"
: "mobile";
};
export const getCurrentDisplayType = (
propsDisplayType,
@ -7,7 +18,7 @@ export const getCurrentDisplayType = (
if (!propsDisplayTypeDetailed) return propsDisplayType;
const detailedDisplayType = propsDisplayTypeDetailed[getCurrentSizeName()];
if (detailedDisplayType) return detailedDisplayType;
if (detailedDisplayType) return detailedDisplayType;
return propsDisplayType;
};

View File

@ -71,6 +71,6 @@ Default.args = {
desktop: "modal",
tablet: "aside",
smallTablet: "modal",
mobile: "modal",
mobile: "aside",
},
};

View File

@ -1,4 +1,3 @@
import { smallTablet } from "../utils/device";
import globalColors from "../utils/globalColors";
const {

View File

@ -35,17 +35,6 @@ export const isTouchDevice = !!(
("ontouchstart" in window || navigator.msMaxTouchPoints > 0)
);
export const getCurrentSizeName = () => {
const innerWidth = window.innerWidth;
return innerWidth >= size.desktop
? "desktop"
: innerWidth <= size.tablet && innerWidth > size.smallTablet
? "tablet"
: innerWidth <= size.smallTablet && innerWidth > size.mobile
? "smallTablet"
: "mobile";
};
export const getModalType = () => {
return window.innerWidth < size.desktop ? "aside" : "modal";
};

View File

@ -93,21 +93,20 @@ class DeleteProfileEverDialogComponent extends React.Component {
<ModalDialog.Footer>
<Button
key="OKBtn"
className="delete-profile_button-delete"
label={t("Common:OKButton")}
size="normal"
primary={true}
scale
onClick={this.onDeleteProfileEver}
isLoading={isRequestRunning}
/>
{/* <Button
className="button-dialog"
key="ReassignBtn"
label={t("Translations:ReassignData")}
size="small"
onClick={this.onReassignDataClick}
isDisabled={isRequestRunning}
/> */}
<Button
label={t("Common:CancelButton")}
size="normal"
scale
onClick={onClose}
isLoading={isRequestRunning}
/>
</ModalDialog.Footer>
</ModalDialogContainer>
);

View File

@ -150,7 +150,6 @@ class DeleteGroupUsersDialogComponent extends React.Component {
isDisabled={!userIds.length}
/>
<Button
className="button-dialog"
label={t("Common:CancelButton")}
size="normal"
scale

View File

@ -13,6 +13,7 @@ class DialogStore {
disableDialogVisible = false;
sendInviteDialogVisible = false;
invitationDialogVisible = false;
deleteDialogVisible = false;
constructor() {
makeAutoObservable(this);