From 3e3b64cf00387985f600c36769c45ed4c06dd23e Mon Sep 17 00:00:00 2001 From: jasinco Date: Wed, 11 Jun 2025 19:05:00 +0800 Subject: [PATCH] Add ImagePreview to Fetch and set privacy policy --- src/Fetch.tsx | 8 +++----- src/ImageWithPrview.tsx | 18 +++++++++--------- src/Policy.tsx | 5 +++++ src/Zone.tsx | 7 +++---- 4 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 src/Policy.tsx diff --git a/src/Fetch.tsx b/src/Fetch.tsx index fc25db9..40cd719 100644 --- a/src/Fetch.tsx +++ b/src/Fetch.tsx @@ -2,6 +2,7 @@ import React from "react" import { FetchPost, MediaPathTrc, SinglePost_t } from "./api" import { z } from 'zod/v4' import { useInfiniteQuery } from "@tanstack/react-query" +import ImageWithPreview from "./ImageWithPrview" // type fetched = z.infer @@ -9,15 +10,12 @@ const Single = ({ post }: { post: z.infer }) => { return (

{post.content}

- {post.enclosure.length > 0 && post.enclosure[0] != null &&
+ {post.enclosure.length > 0 && post.enclosure[0] != null &&
{post.enclosure.map((enc, index) => { if (enc) { - return {`Post } else { return "" diff --git a/src/ImageWithPrview.tsx b/src/ImageWithPrview.tsx index 4ff1039..141c455 100644 --- a/src/ImageWithPrview.tsx +++ b/src/ImageWithPrview.tsx @@ -5,7 +5,7 @@ const ImageWithPreview = ({ remove, }: { src: string - remove: () => void + remove?: () => void }) => { const [show, setShow] = useState(false) return ( @@ -26,14 +26,14 @@ const ImageWithPreview = ({ onClick={() => setShow(false)} >
- - + + {remove && }
diff --git a/src/Policy.tsx b/src/Policy.tsx new file mode 100644 index 0000000..ff31cd1 --- /dev/null +++ b/src/Policy.tsx @@ -0,0 +1,5 @@ +export const Policy = () => { + return
+ Test +
+} diff --git a/src/Zone.tsx b/src/Zone.tsx index ae69878..8114728 100644 --- a/src/Zone.tsx +++ b/src/Zone.tsx @@ -25,13 +25,11 @@ export const Zone = ({ setZone }: { setZone: (zone_name: string) => void }) => { {/* Drawer handle/button */}
- {/* Visual handle indicator */} -
))} +

隱私政策:我們會搜集IP