Skip to content

Commit

Permalink
Merge pull request #548 from bounswe/user-photo-fix
Browse files Browse the repository at this point in the history
Fix user photo
  • Loading branch information
TheRealLowyer authored Dec 16, 2024
2 parents 03bbf03 + be1d1e6 commit 2ca54f4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/tradeverse/src/components/structure/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const Post = ({ post, selectedAnnotation, refetchAnnotations }) => {
<div className={styles.userAndTag}>
<div className={styles.userDetailsContainer}>
<img
src={post.author.profilePhoto ? post.author.profilePhoto : defaultUserImage}
src={post.author.userPhoto ? `http://35.246.188.121:8080/api${post.author.userPhoto}` : defaultUserImage}
className={styles.userImage}
/>
<div className={styles.userDetails}>
Expand Down
1 change: 1 addition & 0 deletions web/tradeverse/src/components/structure/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ const Feed = ({ posts, refreshPosts}) => {
}
};

console.log(" feed", user)


return (
Expand Down
4 changes: 3 additions & 1 deletion web/tradeverse/src/components/structure/postHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ const PostHeader = ({ post }) => {
};
const userLink = user?.name === post.createdBy ? "/account" : `/user/${post.createdBy}`;

console.log(post);

return (
<div className={styles.postHeader}>
<div className={styles.userAndTag}>
<div className={styles.userDetailsContainer}>
<img
src={post.author.profilePhoto ? post.author.profilePhoto : defaultUserImage}
src={post.author.userPhoto ? `http://35.246.188.121:8080/api${post.author.userPhoto}` : defaultUserImage}
className={styles.userImage}
/>
<div className={styles.userDetails}>
Expand Down
1 change: 0 additions & 1 deletion web/tradeverse/src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {

const Home = () => {
const { user } = AuthData();
console.log("user", user);
const [posts, setPosts] = useState([]);
const [recentPosts, setRecentPosts] = useState([]);
const [forYouPosts, setForYouPosts] = useState([]);
Expand Down
2 changes: 2 additions & 0 deletions web/tradeverse/src/pages/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const User = () => {

if (!user) return <p>User not found</p>; // If no user is found



return (
<div className="userPage">
<div className="header">
Expand Down

0 comments on commit 2ca54f4

Please sign in to comment.