diff --git a/client-solid/src/Components/Buttons/Engegament.tsx b/client-solid/src/Components/Buttons/Engegament.tsx new file mode 100644 index 0000000..a8aeaba --- /dev/null +++ b/client-solid/src/Components/Buttons/Engegament.tsx @@ -0,0 +1,22 @@ +import { JSXElement } from "solid-js"; + +import { EngagementIcon } from "../../Util/Icons"; +import { Post } from "../../Util/api"; + +export default function EngagementButton({ post }: { post: Post }): JSXElement { + return ( + <> +
+ + +

{post.votes}

+
+
+ + ); +} diff --git a/client-solid/src/Components/Buttons/Replies.tsx b/client-solid/src/Components/Buttons/Replies.tsx new file mode 100644 index 0000000..f13c088 --- /dev/null +++ b/client-solid/src/Components/Buttons/Replies.tsx @@ -0,0 +1,22 @@ +import { JSXElement } from "solid-js"; + +import { ReplyIcon } from "../../Util/Icons"; +import { Post } from "../../Util/api"; + +export default function ReplyButton({ post }: { post: Post }): JSXElement { + return ( + <> +
+ + +

{post.comments}

+
+
+ + ); +} diff --git a/client-solid/src/Components/Buttons/Report.tsx b/client-solid/src/Components/Buttons/Report.tsx new file mode 100644 index 0000000..13afea2 --- /dev/null +++ b/client-solid/src/Components/Buttons/Report.tsx @@ -0,0 +1,20 @@ +import { JSXElement, Show, useContext } from "solid-js"; + +import { LoginContext } from "../../Context/GlobalState"; +import { ReportIcon } from "../../Util/Icons"; + +export default function ReportButton(): JSXElement { + const login_ctx = useContext(LoginContext)!; + return ( + +
+ +
+
+ ); +} diff --git a/client-solid/src/Components/Buttons/ToPost.tsx b/client-solid/src/Components/Buttons/ToPost.tsx new file mode 100644 index 0000000..78a9d73 --- /dev/null +++ b/client-solid/src/Components/Buttons/ToPost.tsx @@ -0,0 +1,24 @@ +import { useNavigate } from "@solidjs/router"; +import { JSXElement } from "solid-js"; + + + +import { Arrow } from "../../Util/Icons"; +import { Post } from "../../Util/api"; + + +export default function ToPostButton({ post }: { post: Post }): JSXElement { + const nav = useNavigate(); + + return ( +
+ +
+ ); +} \ No newline at end of file diff --git a/client-solid/src/Components/PostSegment.tsx b/client-solid/src/Components/PostSegment.tsx index 903307e..36240b6 100644 --- a/client-solid/src/Components/PostSegment.tsx +++ b/client-solid/src/Components/PostSegment.tsx @@ -1,8 +1,10 @@ -import { useNavigate } from "@solidjs/router"; import { JSXElement, Show } from "solid-js"; -import { Arrow, EngagementIcon } from "../Util/Icons"; import { Post } from "../Util/api"; +import EngagementButton from "./Buttons/Engegament"; +import ReplyButton from "./Buttons/Replies"; +import ReportButton from "./Buttons/Report"; +import ToPostButton from "./Buttons/ToPost"; /** * PostSegment is used to display posts in both the main feed and the post view @@ -12,39 +14,26 @@ import { Post } from "../Util/api"; * @returns {JSXElement} A JSXElement of a post */ export function PostSegment({ post }: { post: Post }): JSXElement { - const nav = useNavigate(); - const dateOfCreation = new Date(post.createdAt).toDateString(); const isEdited = !(post.createdAt == post.updatedAt); return (
+

{dateOfCreation}

+ +

This post has been edited

{post.content}

-
- - - {post.votes} - -
- +
+ + +
+
diff --git a/client-solid/src/Util/Icons.tsx b/client-solid/src/Util/Icons.tsx index 3fc29f7..2b00cfe 100644 --- a/client-solid/src/Util/Icons.tsx +++ b/client-solid/src/Util/Icons.tsx @@ -215,3 +215,22 @@ export function EngagementIcon(): JSXElement { ); } + +export function ReportIcon(): JSXElement { + return ( + + + + ); +} diff --git a/client-solid/tailwind.config.js b/client-solid/tailwind.config.js index a58325f..2bfc6ad 100644 --- a/client-solid/tailwind.config.js +++ b/client-solid/tailwind.config.js @@ -8,8 +8,8 @@ export default { primary: "#286ca8", secondary: "#528cbf", accent: "#6ff7c5", - neutral: "#1f2329", - "base-100": "#12212e", + neutral: "#0369A1", // Main color of replies + "base-100": "#082f49", // Main Color for most components, used in wide variety info: "#8b9be5", success: "#79e2b4", warning: "#efb261",