Nicolas Inchauspe 2023-03-13 13:14:49 +01:00 committed by hasura-bot
parent 823fca2d1c
commit f92d695704
3 changed files with 41 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import React from 'react';
import { ComponentMeta, Story } from '@storybook/react'; import { ComponentMeta, Story } from '@storybook/react';
import { RiPlayFill } from 'react-icons/ri'; import { RiPlayFill } from 'react-icons/ri';
import { Dialog, DialogProps, FooterProps } from './Dialog'; import { Dialog, DialogProps, FooterProps } from './Dialog';
import { hasuraToast } from '../Toasts';
export default { export default {
title: 'components/Dialog', title: 'components/Dialog',
@ -72,3 +73,40 @@ CustomFooter.args = {
isLoading: false, isLoading: false,
footer: <div>custom footer</div>, footer: <div>custom footer</div>,
}; };
export const CollisionWithToast: Story<DialogProps & FooterProps> = args => (
<Dialog
hasBackdrop={args.hasBackdrop}
title={args.title}
description={args.description}
onClose={args.onClose}
>
<>
<div>I am the body!</div>
<Dialog.Footer
callToDeny={args.callToDeny}
callToAction={args.callToAction}
callToActionIconPosition="start"
callToActionIcon={<RiPlayFill />}
onClose={args.onClose}
onSubmit={() =>
hasuraToast({
type: 'error',
title: 'The toast title',
message: 'The toast message',
})
}
isLoading={args.isLoading}
/>
</>
</Dialog>
);
CollisionWithToast.args = {
title: 'Title',
description: 'Description',
callToDeny: 'Cancel',
callToAction: 'Show toast',
hasBackdrop: true,
isLoading: false,
};

View File

@ -40,6 +40,7 @@ export const ToastsHub = ({ className = '' }: { className?: string }) => {
position: 'absolute', position: 'absolute',
transition: 'all 0.3s ease-out', transition: 'all 0.3s ease-out',
opacity: toast.visible ? 1 : 0, opacity: toast.visible ? 1 : 0,
pointerEvents: toast.visible ? 'all' : 'none',
transform: `translate(-100%, ${offset}px)`, transform: `translate(-100%, ${offset}px)`,
zIndex: toast.visible ? 9999 : 9998, zIndex: toast.visible ? 9999 : 9998,
}} }}

View File

@ -10,6 +10,7 @@ import 'react-date-range/dist/theme/default.css'; // theme css file
import { Button } from '@hasura/console-legacy-ce'; import { Button } from '@hasura/console-legacy-ce';
import styles from '../Metrics.module.scss'; import styles from '../Metrics.module.scss';
import clsx from 'clsx';
const DatePickerModal = props => { const DatePickerModal = props => {
const selectionRange = { const selectionRange = {
@ -44,7 +45,7 @@ const DatePickerModal = props => {
id="dateModal" id="dateModal"
onHide={onHide} onHide={onHide}
show={show} show={show}
className={styles.datePickerModalWrapper} className={clsx(styles.datePickerModalWrapper, '!pointer-events-auto')}
> >
<BootstrapModal.Header className={styles.modalHeader} closeButton> <BootstrapModal.Header className={styles.modalHeader} closeButton>
<BootstrapModal.Title className={styles.title}> <BootstrapModal.Title className={styles.title}>