feat: show friends from response

This commit is contained in:
Zamitto 2024-07-10 17:51:53 -03:00
parent 0f0a1e98a3
commit 6ff48605da

View file

@ -1,4 +1,4 @@
import { UserFriend, UserGame, UserProfile } from "@types"; import { UserGame, UserProfile } from "@types";
import cn from "classnames"; import cn from "classnames";
import * as styles from "./user.css"; import * as styles from "./user.css";
@ -79,7 +79,7 @@ export function UserContent({
}; };
const handleOnClickFriend = (userId: string) => { const handleOnClickFriend = (userId: string) => {
console.log(userId); navigate(`/user/${userId}`);
}; };
const handleConfirmSignout = async () => { const handleConfirmSignout = async () => {
@ -326,6 +326,8 @@ export function UserContent({
</div> </div>
</div> </div>
{(isMe ||
(userProfile.friends && userProfile.friends.length > 0)) && (
<div className={styles.friendsSection}> <div className={styles.friendsSection}>
<div <div
style={{ style={{
@ -362,21 +364,7 @@ export function UserContent({
gap: `${SPACING_UNIT}px`, gap: `${SPACING_UNIT}px`,
}} }}
> >
{( {userProfile.friends?.map((friend) => {
[
{
id: "",
displayName: "Punheta Master 123123123123123123",
profileImageUrl:
"https://cdn.discordapp.com/avatars/1239959140785455295/4aff4b901c7a9f5f814b4379b6cfd58a.webp",
},
{
id: "",
displayName: "Hydra Launcher",
profileImageUrl: null,
},
] as UserFriend[]
).map((friend) => {
return ( return (
<button <button
key={friend.id} key={friend.id}
@ -406,6 +394,7 @@ export function UserContent({
})} })}
</div> </div>
</div> </div>
)}
</div> </div>
</div> </div>
</> </>