Skip to content

Commit

Permalink
fix: preview video
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 4, 2024
1 parent 92d1a7b commit 63b1926
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/renderer/src/modules/entry-column/video-item.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { m } from "@renderer/components/common/Motion"
import { Image } from "@renderer/components/ui/image"
import { useModalStack } from "@renderer/components/ui/modal"
import { NoopChildren } from "@renderer/components/ui/modal/stacked/utils"
Expand Down Expand Up @@ -36,20 +37,25 @@ export function VideoItem({ entryId, entryPreview, translation }: UniversalItemP
<GridItem entryId={entryId} entryPreview={entryPreview} translation={translation}>
<div
className="w-full"
onClick={() => iframeSrc && modalStack.present({
title: "",
content: ({ dismiss }) => (
// eslint-disable-next-line @eslint-react/dom/no-missing-iframe-sandbox
<iframe
src={iframeSrc}
className="size-full p-12"
onClick={() => dismiss()}
/>
),
clickOutsideToDismiss: true,
CustomModalComponent: NoopChildren,
overlay: true,
})}
onClick={(e) => {
if (iframeSrc) {
e.stopPropagation()
modalStack.present({
title: "",
content: ({ dismiss }) => (
<m.iframe
exit={{ scale: 0.94, opacity: 0 }}
src={iframeSrc}
className="size-full p-12"
onClick={() => dismiss()}
/>
),
clickOutsideToDismiss: true,
CustomModalComponent: NoopChildren,
overlay: true,
})
}
}}
>
<div className="overflow-x-auto" ref={ref}>
{miniIframeSrc && hovered ? (
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/modules/feed-column/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export function FeedList({
<Link
to="/discover"
className="-mt-36 flex h-full flex-1 flex-col items-center justify-center gap-2"
onClick={stopPropagation}
>
<i className="i-mgc-add-cute-re text-3xl" />
Add some feeds
Expand Down

0 comments on commit 63b1926

Please sign in to comment.