Refactor of replies,Icon Swap
This commit is contained in:
parent
999d180b24
commit
b5b256f6e9
3 changed files with 56 additions and 1 deletions
17
client-solid/src/Components/Buttons/CommentsButton.tsx
Normal file
17
client-solid/src/Components/Buttons/CommentsButton.tsx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { JSXElement } from "solid-js";
|
||||
|
||||
import { CommentsIcon } from "../../Util/Icons";
|
||||
import { Post } from "../../Util/api";
|
||||
|
||||
export default function CommentsBUtton({ post }: { post: Post }): JSXElement {
|
||||
return (
|
||||
<>
|
||||
<div class="flex p-1">
|
||||
<CommentsIcon />
|
||||
<span class="text-1xl countdown text-center pt-1.5 px-1.5">
|
||||
<p style={{ "--value": 11 }}>{post.comments}</p>
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
20
client-solid/src/Components/Buttons/Reply.tsx
Normal file
20
client-solid/src/Components/Buttons/Reply.tsx
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { JSXElement, Show, useContext } from "solid-js";
|
||||
|
||||
import { LoginContext } from "../../Context/GlobalState";
|
||||
import { ReplyIcon, ReportIcon } from "../../Util/Icons";
|
||||
|
||||
export default function ReplyButton(): JSXElement {
|
||||
const login_ctx = useContext(LoginContext)!;
|
||||
return (
|
||||
<Show when={login_ctx.loggedIn()}>
|
||||
<div class="flex p-1">
|
||||
<button
|
||||
class="rounded-base btn btn-xs hover:border-primary"
|
||||
aria-label="Report post or comment"
|
||||
>
|
||||
<ReplyIcon />
|
||||
</button>
|
||||
</div>
|
||||
</Show>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue