@atlaskit/modal-dialog
Version:
A modal dialog displays content that requires user interaction, in a layer above the page.
18 lines • 492 B
JavaScript
import { width } from './constants';
export const dialogWidth = input => {
if (!input) {
return 'auto';
}
const isWidthName = width.values.indexOf(input.toString()) !== -1;
const widthName = isWidthName && input;
if (widthName) {
return `${width.widths[widthName]}px`;
}
return typeof input === 'number' ? `${input}px` : input;
};
export const dialogHeight = input => {
if (!input) {
return 'auto';
}
return typeof input === 'number' ? `${input}px` : input;
};