mirror of
https://github.com/AnimeThemes/animethemes-web.git
synced 2026-07-11 01:24:31 +02:00
fix: Dialogs can now be correctly closed on mobile (#247)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -99,5 +99,5 @@ VideoMenu.fragments = {
|
|||||||
basename
|
basename
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user