From 999d180b242d84537845e25439f3f9d9bdec242a Mon Sep 17 00:00:00 2001 From: Hollgy Date: Fri, 22 Mar 2024 11:45:52 +0100 Subject: [PATCH] Added dropdown for report and removal of post, added removal of post frontend --- .../Components/Buttons/RemovePostButton.tsx | 19 +++++++++++++++++++ client-solid/src/Components/PostSegment.tsx | 17 ++++++++++++++--- client-solid/src/Util/Icons.tsx | 18 ++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 client-solid/src/Components/Buttons/RemovePostButton.tsx diff --git a/client-solid/src/Components/Buttons/RemovePostButton.tsx b/client-solid/src/Components/Buttons/RemovePostButton.tsx new file mode 100644 index 0000000..3d53908 --- /dev/null +++ b/client-solid/src/Components/Buttons/RemovePostButton.tsx @@ -0,0 +1,19 @@ +import { JSXElement } from "solid-js"; + +import { RemovePostIcon } from "../../Util/Icons"; +import { Post } from "../../Util/api"; + +export default function RemovePostButton({ post }: { post: Post }): JSXElement { + return ( + <> +
+ +
+ + ); +} diff --git a/client-solid/src/Components/PostSegment.tsx b/client-solid/src/Components/PostSegment.tsx index 134c818..94ae824 100644 --- a/client-solid/src/Components/PostSegment.tsx +++ b/client-solid/src/Components/PostSegment.tsx @@ -5,6 +5,7 @@ import EngagementButton from "./Buttons/Engegament"; import ReplyButton from "./Buttons/Replies"; import ReportButton from "./Buttons/Report"; import ToPostButton from "./Buttons/ToPost"; +import RemovePostButton from "./Buttons/RemovePostButton"; /** * PostSegment is used to display posts in both the main feed and the post view @@ -21,13 +22,23 @@ export function PostSegment({ post }: { post: Post }): JSXElement {
-

{dateOfCreation}

- +

{dateOfCreation}

+

This post has been edited

-

{post.content}

+

{post.content}

diff --git a/client-solid/src/Util/Icons.tsx b/client-solid/src/Util/Icons.tsx index 2b00cfe..68bf9ca 100644 --- a/client-solid/src/Util/Icons.tsx +++ b/client-solid/src/Util/Icons.tsx @@ -234,3 +234,21 @@ export function ReportIcon(): JSXElement { ); } +export function RemovePostIcon(): JSXElement { + return ( + + + + ); +}