Update post-cards to show profile pic correctly

This commit is contained in:
Pico2x 2022-10-12 17:31:00 +01:00
parent fd7d4eb5e2
commit 00acc262a0
3 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,7 @@ export type Post = {
// denormalized user fields
creatorName: string
creatorUsername: string
creatorAvatarUrl?: string
}
export type DateDoc = Post & {

View File

@ -102,6 +102,7 @@ export const createpost = newEndpoint({}, async (req, auth) => {
contractSlug,
creatorName: creator.name,
creatorUsername: creator.username,
creatorAvatarUrl: creator.avatarUrl,
})
await postRef.create(post)

View File

@ -29,7 +29,11 @@ export function PostCard(props: {
<Row className="flex grow justify-between">
<div className="">
<Row className="items-center text-sm ">
<Avatar className="mx-1 h-7 w-7" username={post.creatorUsername} />
<Avatar
className="mx-1 h-7 w-7"
username={post.creatorUsername}
avatarUrl={post.creatorAvatarUrl}
/>
<UserLink
className=" text-gray-400"
name={post.creatorName}