Skip to content

Commit

Permalink
Merge pull request #3884 from thematters/fix/dialogbeta-handle-clickable
Browse files Browse the repository at this point in the history
Fix dialogbeta handle clickable on mobile
  • Loading branch information
wlliaml authored Oct 11, 2023
2 parents 69c1215 + f33871a commit 37e04a6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions src/components/DialogBeta/Handle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useIntl } from 'react-intl'

import styles from './styles.module.css'

interface HandleProps {
closeDialog: () => void
}

const Handle: React.FC<HandleProps> = ({ closeDialog, ...props }) => {
const intl = useIntl()

return (
<button
type="button"
className={styles.handle}
aria-label={intl.formatMessage({ defaultMessage: 'Close' })}
onClick={closeDialog}
{...props}
>
<span className={styles.icon} />
</button>
)
}

export default Handle
2 changes: 1 addition & 1 deletion src/components/DialogBeta/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { capitalizeFirstLetter, dom } from '~/common/utils'
import { Media, useOutsideClick } from '~/components'

import { RoundedButton, TextButton } from '../Dialog/Buttons'
import Handle from '../Dialog/Handle'
import Header from '../Dialog/Header'
import Lazy from '../Dialog/Lazy'
import Content from './Content'
import Footer from './Footer'
import Handle from './Handle'
import styles from './styles.module.css'

export interface DialogBetaOverlayProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/DialogBeta/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
position: absolute;
top: 0;
left: 50%;
z-index: var(--z-index-dialog);
z-index: calc(var(--z-index-dialog) + 1);
padding: var(--spacing-x-tight);
transform: translateX(-50%);

Expand Down

1 comment on commit 37e04a6

@vercel
Copy link

@vercel vercel bot commented on 37e04a6 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.