Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gallery close button being hidden behind the title #1181

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/ui/MobileDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export const DialogContent = React.forwardRef<any, Props>(
className={clx(fullScreen ? 'dialog-wide' : 'dialog-default')} {...props} ref={forwardedRef}
>
<div className='flex items-center px-2'>
<DialogPrimitive.Title className='dialog-title'>
Copy link
Collaborator

@clintonlunn clintonlunn Nov 2, 2024

Choose a reason for hiding this comment

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

@julianlam after some investigation, I believe the issue is actually that the <PhotoGalleryModal /> component is using the defaults.css css rules, versus what was being tested in fdb64aa, that was referencing the global.css file.

I think some evidence to point to this is the new /climb//climbId page when updated to Next13 in #1195, the DialogClose button is correctly showing. This new page would be referencing global.css.

So while your fix works, maybe the fix is instead to alter the css in defaults.css to match global.css so we aren't relying on order, but instead restricting the title from overlapping with the close button:

  .dialog-title {
    @apply flex-grow text-center bg-base-100 leading-none;
  }

  .dialog-close-button {
    @apply mx-auto z-auto;
  }

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Given that the PhotoGalleryModal is only invoked by the climbs page (I don't actually know if this is true), and that it is being refactored, might be this PR is moot and can be closed 😄

Copy link
Collaborator

Choose a reason for hiding this comment

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

For sure, I do think it's still valid to fix though because it definitely is an issue during the transition period of old climb page to new climb page.

{title}
</DialogPrimitive.Title>
<DialogPrimitive.Close aria-label='Close' asChild className='dialog-close-button'>
<button className='btn btn-circle btn-ghost outline-none'>
<XMarkIcon size={24} />
</button>
</DialogPrimitive.Close>
<DialogPrimitive.Title className='dialog-title'>
{title}
</DialogPrimitive.Title>
</div>
{children}
</DialogPrimitive.Content>
Expand Down
Loading