Refactor: Create modal_classes constant
This commit is contained in:
parent
4f80346602
commit
63dec536e6
2 changed files with 5 additions and 4 deletions
|
|
@ -826,3 +826,6 @@ export const DEFAULT_TABLE_ALERT_TITLE = "No Data Available";
|
||||||
export const LOCATIONS_TO_RETURN = ["/flow/", "/settings/"];
|
export const LOCATIONS_TO_RETURN = ["/flow/", "/settings/"];
|
||||||
|
|
||||||
export const MAX_BATCH_SIZE = 50;
|
export const MAX_BATCH_SIZE = 50;
|
||||||
|
|
||||||
|
export const MODAL_CLASSES =
|
||||||
|
"nopan nodelete nodrag noundo nocopy fixed inset-0 bottom-0 left-0 right-0 top-0 z-50 overflow-auto bg-blur-shared backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0";
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import {
|
||||||
import { NodeType } from "../types/flow";
|
import { NodeType } from "../types/flow";
|
||||||
import { FlowState } from "../types/tabs";
|
import { FlowState } from "../types/tabs";
|
||||||
import TableAutoCellRender from "../components/tableComponent/components/tableAutoCellRender";
|
import TableAutoCellRender from "../components/tableComponent/components/tableAutoCellRender";
|
||||||
|
import { MODAL_CLASSES } from "../constants/constants";
|
||||||
|
|
||||||
export function classNames(...classes: Array<string>): string {
|
export function classNames(...classes: Array<string>): string {
|
||||||
return classes.filter(Boolean).join(" ");
|
return classes.filter(Boolean).join(" ");
|
||||||
|
|
@ -408,10 +409,7 @@ export function extractColumnsFromRows(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isThereModal(): boolean {
|
export function isThereModal(): boolean {
|
||||||
const modal = document.body.getElementsByClassName(
|
const modal = document.body.getElementsByClassName(MODAL_CLASSES);
|
||||||
"nopan nodelete nodrag noundo nocopy fixed inset-0 bottom-0 left-0 right-0 top-0 z-50 overflow-auto bg-blur-shared backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
||||||
);
|
|
||||||
console.log(modal);
|
|
||||||
if (modal.length > 0) return true;
|
if (modal.length > 0) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue