From af2f9d135b2b1b90aaf1a38bf7cf0b34a1899127 Mon Sep 17 00:00:00 2001 From: mehbark Date: Fri, 28 Apr 2023 20:20:05 -0400 Subject: [PATCH] meta tags --- components/Conv.tsx | 7 +++++++ components/Meta.tsx | 29 +++++++++++++++++++++++++++++ islands/Home.tsx | 11 +++++++++-- islands/Interactive.tsx | 9 ++++++++- routes/m/[message_id].tsx | 17 ++++++++++++++++- 5 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 components/Meta.tsx diff --git a/components/Conv.tsx b/components/Conv.tsx index a45d57d..2aa11b3 100644 --- a/components/Conv.tsx +++ b/components/Conv.tsx @@ -3,6 +3,7 @@ import Msg from "components/Msg.tsx"; import { conv_style, msg_style, page_style } from "style"; import { Head } from "$fresh/runtime.ts"; import WithStyleSheet from "components/WithStyleSheet.tsx"; +import Meta from "components/Meta.tsx"; export default function Conv({ conv, @@ -20,6 +21,12 @@ export default function Conv({ {conv_.name} +

+ + + + + + ); +} +{ + /* + + + */ +} diff --git a/islands/Home.tsx b/islands/Home.tsx index a5dbaa4..d02d95a 100644 --- a/islands/Home.tsx +++ b/islands/Home.tsx @@ -2,10 +2,11 @@ import { useState } from "preact/hooks"; import { Database } from "types"; import { Head } from "$fresh/runtime.ts"; import { DEFAULT_STYLE } from "style"; -import ConversationLink from "components/ConversationLink.tsx"; -import WithStyleSheet from "components/WithStyleSheet.tsx"; import { fetch_db } from "db"; import { URL } from "utils"; +import ConversationLink from "components/ConversationLink.tsx"; +import WithStyleSheet from "components/WithStyleSheet.tsx"; +import Meta from "components/Meta.tsx"; export default function Home({ db }: { db: Database }) { const [data, setData] = useState(db); @@ -18,6 +19,12 @@ export default function Home({ db }: { db: Database }) { Freshter Logs +

diff --git a/islands/Interactive.tsx b/islands/Interactive.tsx index ceb682a..d1d4587 100644 --- a/islands/Interactive.tsx +++ b/islands/Interactive.tsx @@ -6,7 +6,8 @@ import WithStyleSheet from "components/WithStyleSheet.tsx"; import AddMsg from "components/AddMsg.tsx"; import PresetSelector from "components/PresetSelector.tsx"; import PresetCreator from "components/PresetCreator.tsx"; -import { fetch_db } from "../common/db.ts"; +import { fetch_db } from "db"; +import Meta from "components/Meta.tsx"; const UPDATE_DB_INTERVAL_MS = 3000; @@ -46,6 +47,12 @@ export default function Interactive({ return ( <> + > = { async GET(_, ctx) { @@ -22,6 +24,19 @@ export default function MessagePreview({ params.message_id && data.unwrap().messages[params.message_id] ) { - return ; + const db = data.unwrap(); + const id = params.message_id; + const msg = db.messages[id]; + return ( + <> + + + + ); } }