fixed DeleteProfileEver and DeleteUsersDialog + fixed ModalDialogComponent
This commit is contained in:
parent
f88b82670a
commit
24c0397ef0
@ -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;
|
||||
};
|
||||
|
@ -71,6 +71,6 @@ Default.args = {
|
||||
desktop: "modal",
|
||||
tablet: "aside",
|
||||
smallTablet: "modal",
|
||||
mobile: "modal",
|
||||
mobile: "aside",
|
||||
},
|
||||
};
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { smallTablet } from "../utils/device";
|
||||
import globalColors from "../utils/globalColors";
|
||||
|
||||
const {
|
||||
|
@ -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";
|
||||
};
|
||||
|
@ -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>
|
||||
);
|
||||
|
@ -150,7 +150,6 @@ class DeleteGroupUsersDialogComponent extends React.Component {
|
||||
isDisabled={!userIds.length}
|
||||
/>
|
||||
<Button
|
||||
className="button-dialog"
|
||||
label={t("Common:CancelButton")}
|
||||
size="normal"
|
||||
scale
|
||||
|
@ -13,6 +13,7 @@ class DialogStore {
|
||||
disableDialogVisible = false;
|
||||
sendInviteDialogVisible = false;
|
||||
invitationDialogVisible = false;
|
||||
deleteDialogVisible = false;
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
|
Loading…
Reference in New Issue
Block a user