diff --git a/src/renderer/src/components/entry-content.tsx b/src/renderer/src/components/entry-content.tsx index 3036a864a..d61ed5812 100644 --- a/src/renderer/src/components/entry-content.tsx +++ b/src/renderer/src/components/entry-content.tsx @@ -1,6 +1,7 @@ import { parseHtml } from "@renderer/lib/parse-html" import { ActivedEntry } from "@renderer/lib/types" import { useEffect, useState } from "react" +import { m } from "framer-motion" export function EntryContent({ entry }: { entry: ActivedEntry }) { const [content, setContent] = useState() @@ -14,7 +15,13 @@ export function EntryContent({ entry }: { entry: ActivedEntry }) { }, [entry?.content]) return ( -
+
-
+ ) } diff --git a/src/renderer/src/pages/index.tsx b/src/renderer/src/pages/index.tsx index 3c3db20da..8f0ee5314 100644 --- a/src/renderer/src/pages/index.tsx +++ b/src/renderer/src/pages/index.tsx @@ -1,9 +1,10 @@ import { FeedColumn } from "@renderer/components/feed-column" import { EntryColumn } from "@renderer/components/entry-column" -import { useState } from "react" +import { useEffect, useState } from "react" import { ActivedList, ActivedEntry } from "@renderer/lib/types" import { cn } from "@renderer/lib/utils" import { EntryContent } from "@renderer/components/entry-content" +import { AnimatePresence } from "framer-motion" const wideMode = [1, 2, 3, 4] @@ -16,6 +17,10 @@ export function Component() { }) const [activedEntry, setActivedEntry] = useState(null) + useEffect(() => { + setActivedEntry(null) + }, [activedList]) + return (
@@ -35,11 +40,14 @@ export function Component() { setActivedEntry={setActivedEntry} />
- {!(activedList && wideMode.includes(activedList.view)) && ( -
- -
- )} + + {!(activedList && wideMode.includes(activedList.view)) && + activedEntry && ( +
+ +
+ )} +
) }