Skip to content

Commit

Permalink
fix(client): update readme & fix defaultAppPost
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-ojha committed May 29, 2022
1 parent 903f9bf commit cb47c35
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 29 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<div align="center">

[<img src="./appIcon.ico" style="width:100px;" alt="app Icon"/><h1 style="font-size:60px; width:100%;">Social</h1>](./appIcon.ico)



[![License](https://img.shields.io/github/license/Roman-Ojha/Social-Application?color=%23d450cf&style=for-the-badge)](https://opensource.org/licenses/MIT)
![GitHub repo size](https://img.shields.io/github/repo-size/Roman-Ojha/Social-Application?color=%234980cc&label=Size&logo=GitHub&style=for-the-badge)
![GitHub package.json version](https://img.shields.io/github/package-json/v/Roman-Ojha/Social-Application?color=%2300c2b8&logo=V&style=for-the-badge)

# 🤝Social-Media Application🤝
# https://rsocial.vercel.app

</div>

Expand Down
58 changes: 31 additions & 27 deletions client/src/components/HomePage/DisplayFollowedUserPost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,37 @@ const DisplayFollowedUserPost = () => {
);
return (
<>
{followedUserPostDataStore.map((user, key) => {
const userCreateRandomPost = {
...user,
posts: user.posts.sort((a, b) => Math.random() - 0.5),
};
const postElement = userCreateRandomPost.posts.map((post) => {
return (
<PostBox
key={post.id}
userMainInformation={user}
userFeedData={post}
user={user.id} // required: user = id of the user who post this
/>
);
});
if (
followedUserPostDataStore.length === 1 &&
postElement[0].props.userMainInformation.userID === admin.adminUserID
) {
return [<DefaultSocialPost key={key} />, ...postElement];
} else if (postElement.length > 0) {
return postElement;
} else {
// console.log("third");
return <DefaultSocialPost key={key} />;
}
})}
{followedUserPostDataStore.length === 0 ? (
<DefaultSocialPost />
) : (
followedUserPostDataStore.map((user, key) => {
const userCreateRandomPost = {
...user,
posts: user.posts.sort((a, b) => Math.random() - 0.5),
};
const postElement = userCreateRandomPost.posts.map((post) => {
return (
<PostBox
key={post.id}
userMainInformation={user}
userFeedData={post}
user={user.id} // required: user = id of the user who post this
/>
);
});
if (
followedUserPostDataStore.length === 1 &&
postElement[0].props.userMainInformation.userID ===
admin.adminUserID
) {
return [<DefaultSocialPost key={key} />, ...postElement];
} else if (postElement.length > 0) {
return postElement;
} else {
return <DefaultSocialPost key={key} />;
}
})
)}
</>
);
};
Expand Down

1 comment on commit cb47c35

@roman-ojha
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for social ready!

✅ Preview
https://social-hj4yk5klc-razzroman98-gmailcom.vercel.app
https://rsocial.vercel.app

Built with commit cb47c35.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.