mirror of
https://github.com/usatiuk/y.git
synced 2025-10-29 02:37:49 +01:00
fix profile display
This commit is contained in:
@@ -19,11 +19,19 @@ export function Profile({ self }: IProfileProps) {
|
|||||||
return <div>Error</div>;
|
return <div>Error</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { posts } = loaderData;
|
||||||
|
|
||||||
|
const user = self ? homeContext.user : loaderData.user;
|
||||||
|
|
||||||
|
if (!user || isError(user)) {
|
||||||
|
return <div>Error</div>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"profileView"}>
|
<div className={"profileView"}>
|
||||||
<div className={"profileInfo"}>
|
<div className={"profileInfo"}>
|
||||||
<span className={"fullName"}>{homeContext.user.fullName}</span>
|
<span className={"fullName"}>{user.fullName}</span>
|
||||||
<span className={"username"}>{homeContext.user.fullName}</span>
|
<span className={"username"}>{user.username}</span>
|
||||||
</div>
|
</div>
|
||||||
{self && (
|
{self && (
|
||||||
<div className={"newPost"}>
|
<div className={"newPost"}>
|
||||||
@@ -38,10 +46,7 @@ export function Profile({ self }: IProfileProps) {
|
|||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<PostList
|
<PostList posts={posts} selfUuid={homeContext.user.uuid} />
|
||||||
posts={loaderData.posts}
|
|
||||||
selfUuid={homeContext.user.uuid}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user