fix: Dialogs can now be correctly closed on mobile (#247)

This commit is contained in:
Mani
2026-01-25 05:01:11 +01:00
committed by GitHub
parent cdb5f41404
commit 505347face
3 changed files with 8 additions and 10 deletions
+6 -6
View File
@@ -105,9 +105,9 @@ export function ThemeSummaryCard({
const videoSlug = createVideoSlug(theme, entry, video); const videoSlug = createVideoSlug(theme, entry, video);
const href = `/anime/${anime.slug}/${videoSlug}`; const href = `/anime/${anime.slug}/${videoSlug}`;
function handleToggleExpand(event: MouseEvent) { function handleToggleExpand(event: MouseEvent, filterLinks = false) {
if (isLink(event.target)) { if (filterLinks && isLink(event.target)) {
event.stopPropagation(); return;
} else if (expandable && !isMobile) { } else if (expandable && !isMobile) {
toggleExpanded(); toggleExpanded();
} }
@@ -124,11 +124,11 @@ export function ThemeSummaryCard({
return ( return (
<StyledWrapper> <StyledWrapper>
<SummaryCard onClick={handleToggleExpand} {...props}> <SummaryCard {...props}>
<Link href={href} onClick={() => onPlay?.()}> <Link href={href} onClick={() => onPlay?.()}>
<SummaryCard.Cover src={smallCover} /> <SummaryCard.Cover src={smallCover} />
</Link> </Link>
<SummaryCard.Body> <SummaryCard.Body onClick={(event) => handleToggleExpand(event, true)}>
<SummaryCard.Title> <SummaryCard.Title>
<SongTitle song={theme.song} href={href} onClick={() => onPlay?.()} /> <SongTitle song={theme.song} href={href} onClick={() => onPlay?.()} />
<Performances song={theme.song} artist={artist} /> <Performances song={theme.song} artist={artist} />
@@ -143,7 +143,7 @@ export function ThemeSummaryCard({
</SummaryCard.Description> </SummaryCard.Description>
</SummaryCard.Body> </SummaryCard.Body>
{children} {children}
<StyledOverlayButtons onClick={(event) => event.stopPropagation()}> <StyledOverlayButtons>
<ThemeMenu theme={theme} /> <ThemeMenu theme={theme} />
{expandable && ( {expandable && (
<StyledExpandButton <StyledExpandButton
+1 -3
View File
@@ -110,9 +110,7 @@ export function VideoSummaryCard({
</SummaryCard.Description> </SummaryCard.Description>
</SummaryCard.Body> </SummaryCard.Body>
{menu !== null ? ( {menu !== null ? (
<StyledOverlayButtons onClick={(event) => event.stopPropagation()}> <StyledOverlayButtons>{menu ?? <VideoMenu entry={entry} video={video} />}</StyledOverlayButtons>
{menu ?? <VideoMenu entry={entry} video={video} />}
</StyledOverlayButtons>
) : null} ) : null}
{append} {append}
</SummaryCard> </SummaryCard>
+1 -1
View File
@@ -99,5 +99,5 @@ VideoMenu.fragments = {
basename basename
} }
} }
` `,
}; };