diff --git a/pkg/view/src/pages/account.tsx b/pkg/view/src/pages/account.tsx index 1782284..cbb9fd3 100644 --- a/pkg/view/src/pages/account.tsx +++ b/pkg/view/src/pages/account.tsx @@ -3,6 +3,9 @@ import { useParams } from "@solidjs/router"; import PostList from "../components/PostList.tsx"; import NameCard from "../components/NameCard.tsx"; +import PostPublish from "../components/PostPublish.tsx"; +import { createStore } from "solid-js/store"; +import { closeModel, openModel } from "../scripts/modals.ts"; export default function DashboardPage() { const [error, setError] = createSignal(null); @@ -27,6 +30,25 @@ export default function DashboardPage() { } } + function setMeta(data: any, field: string, open = true) { + const meta: { [id: string]: any } = { + reposting: null, + replying: null, + editing: null + }; + meta[field] = data; + setPublishMeta(meta); + + if (open) openModel("#post-publish"); + else closeModel("#post-publish"); + } + + const [publishMeta, setPublishMeta] = createStore({ + replying: null, + reposting: null, + editing: null + }); + return ( <>
@@ -44,7 +66,28 @@ export default function DashboardPage() { - + + + + + + setMeta(item, "reposting")} + onReply={(item) => setMeta(item, "replying")} + onEdit={(item) => setMeta(item, "editing")} + /> ); } \ No newline at end of file