Skip to content

Commit

Permalink
add src to composePost
Browse files Browse the repository at this point in the history
  • Loading branch information
Osmait committed Nov 2, 2023
1 parent 2625794 commit bf4d755
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
11 changes: 7 additions & 4 deletions FrontendRedSocial/red-social/app/components/feed.tsx
Expand Up @@ -37,17 +37,20 @@ export function Feed({ posts }: Props) {
}

await createPost(data, token);
console.log(data);
router.refresh();

postFrom.current.reset();

};

const imgUrl = user?.img ? user.img : "https://avatars.dicebear.com/v2/male/dec006c73441fcd643d5cc092c35d14c.svg"
return (
<div id="feed-id">
<ComposePost postFrom={postFrom} handlerSubmit={handlerSubmit} />
{posts.map((post) => (
<ComposePost img={imgUrl} postFrom={postFrom} handlerSubmit={handlerSubmit} />

{posts ? posts.map((post) => (
<CardPost key={post.post.id} post={post} />
))}
)) : <p>No hay Post..</p>}
</div>
);
}
1 change: 1 addition & 0 deletions FrontendRedSocial/red-social/app/home/page.tsx
Expand Up @@ -21,5 +21,6 @@ export default async function Home() {
</div>
<Feed posts={posts} />
</div>

);
}
12 changes: 12 additions & 0 deletions FrontendRedSocial/red-social/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions FrontendRedSocial/red-social/package.json
Expand Up @@ -40,6 +40,7 @@
"next-themes": "^0.2.1",
"postcss": "8.4.27",
"react": "18.2.0",
"react-content-loader": "^6.2.1",
"react-dom": "18.2.0",
"socket.io-client": "^4.7.2",
"tailwind-variants": "^0.1.13",
Expand Down

0 comments on commit bf4d755

Please sign in to comment.