Goal/Funnel mobile friendly changes. Polish event-data filters UI/UX
This commit is contained in:
1 parent
35680918c0
commit
09e5196ea3
12 files changed
+472
-343
No files matched your search
@@ -18,6 +18,8 @@ export interface DialogButtonProps extends Omit<ButtonProps, 'children'> {
|
||||
height?: string;
|
||||
minWidth?: string;
|
||||
minHeight?: string;
|
||||
isOpen?: boolean;
|
||||
onOpenChange?: (isOpen: boolean) => void;
|
||||
children?: DialogProps['children'];
|
||||
}
|
||||
|
||||
@@ -29,6 +31,8 @@ export function DialogButton({
|
||||
height,
|
||||
minWidth,
|
||||
minHeight,
|
||||
isOpen,
|
||||
onOpenChange,
|
||||
children,
|
||||
...props
|
||||
}: DialogButtonProps) {
|
||||
@@ -39,29 +43,44 @@ export function DialogButton({
|
||||
minWidth,
|
||||
minHeight,
|
||||
maxHeight: 'calc(100dvh - 40px)',
|
||||
overflowY: 'auto',
|
||||
padding: '32px',
|
||||
};
|
||||
|
||||
if (isMobile) {
|
||||
style.width = '100%';
|
||||
style.height = '100%';
|
||||
style.minWidth = undefined;
|
||||
style.minHeight = undefined;
|
||||
style.maxHeight = '100%';
|
||||
style.overflowY = 'auto';
|
||||
}
|
||||
|
||||
const dialog = (
|
||||
<Dialog
|
||||
variant={isMobile ? 'sheet' : undefined}
|
||||
title={title === undefined ? label : title}
|
||||
style={style}
|
||||
>
|
||||
{children}
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
if (isOpen !== undefined) {
|
||||
return (
|
||||
<Modal isOpen={isOpen} onOpenChange={onOpenChange} isDismissable placement={isMobile ? 'fullscreen' : 'center'}>
|
||||
{dialog}
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<DialogTrigger>
|
||||
<Button {...props}>
|
||||
<IconLabel icon={icon} label={label} />
|
||||
</Button>
|
||||
<Modal placement={isMobile ? 'fullscreen' : 'center'}>
|
||||
<Dialog
|
||||
variant={isMobile ? 'sheet' : undefined}
|
||||
title={title === undefined ? label : title}
|
||||
style={style}
|
||||
>
|
||||
{children}
|
||||
</Dialog>
|
||||
{dialog}
|
||||
</Modal>
|
||||
</DialogTrigger>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user