diff --git a/src/main/web/organisms/Post.tsx b/src/main/web/organisms/Post.tsx index f3680354..bd7bcff3 100644 --- a/src/main/web/organisms/Post.tsx +++ b/src/main/web/organisms/Post.tsx @@ -4,14 +4,22 @@ import {Avatar} from "../atoms/Avatar"; import {Favorite, MoreVert, Reply, ScreenRotationAlt} from "@suid/icons-material"; import {ShareScopeIndicator} from "../molecules/ShareScopeIndicator"; import {PostResponse} from "../generated"; +import {useApi} from "../lib/ApiProvider"; export const Post: Component<{ post: PostResponse }> = (props) => { + + const api = useApi() + const [anchorEl, setAnchorEl] = createSignal(null) const open = () => Boolean(anchorEl()); const handleClose = () => { setAnchorEl(null); } + const handleFavorite = () => { + api().postsPostIdReactionsPost({reaction: "❤"}, props.post.id) + } + return ( } title={props.post.user.screenName} @@ -32,7 +40,7 @@ export const Post: Component<{ post: PostResponse }> = (props) => { - +