wix-style-react
Version:
19 lines (17 loc) • 381 B
JavaScript
const ZIndexValues = {
Page: 1,
Notification: 4000,
Modal: 5000,
Tooltip: 6000,
};
export function ZIndex(layerName) {
const zIndexValue = ZIndexValues[layerName];
if (!zIndexValue) {
throw new Error(
`ZIndex: Layer with name ${layerName} does NOT exist. Layers = ${Object.keys(
ZIndexValues,
).join(', ')}`,
);
}
return zIndexValue;
}