diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 631e50c1..9e190778 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -266,6 +266,7 @@ "public": "Public", "private": "Private", "friends_only": "Friends only", - "privacy": "Privacy" + "privacy": "Privacy", + "blocked_users": "Blocked users" } } diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 5b24b574..036e2ff0 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -266,6 +266,7 @@ "privacy": "Privacidade", "private": "Privado", "friends_only": "Apenas amigos", - "public": "Público" + "public": "Público", + "blocked_users": "Usuários bloqueados" } } diff --git a/src/renderer/src/pages/user/user-content.tsx b/src/renderer/src/pages/user/user-content.tsx index 7367ed5f..b9502231 100644 --- a/src/renderer/src/pages/user/user-content.tsx +++ b/src/renderer/src/pages/user/user-content.tsx @@ -160,6 +160,11 @@ export function UserContent({ }; const showFriends = isMe || userProfile.totalFriends > 0; + const showProfileContent = + isMe || + userProfile.profileVisibility === "PUBLIC" || + (userProfile.relation?.status === "ACCEPTED" && + userProfile.profileVisibility === "FRIENDS"); const getProfileActions = () => { if (isMe) { @@ -362,125 +367,73 @@ export function UserContent({ -
-
-

{t("activity")}

- - {!userProfile.recentGames.length ? ( -
-
- -
-

{t("no_recent_activity_title")}

- {isMe && ( -

- {t("no_recent_activity_description")} -

- )} -
- ) : ( -
- {userProfile.recentGames.map((game) => ( - - ))} -
- )} -
- -
+ {showProfileContent && ( +
-
-

{t("library")}

+

{t("activity")}

+ {!userProfile.recentGames.length ? ( +
+
+ +
+

{t("no_recent_activity_title")}

+ {isMe && ( +

+ {t("no_recent_activity_description")} +

+ )} +
+ ) : (
-

- {userProfile.libraryGames.length} -

-
- {t("total_play_time", { amount: formatPlayTime() })} -
- {userProfile.libraryGames.map((game) => ( - - ))} -
+
+

{game.title}

+ + {t("last_time_played", { + period: formatDistance( + game.lastTimePlayed!, + new Date(), + { + addSuffix: true, + } + ), + })} + +
+ + ))} +
+ )}
- {showFriends && ( -
- - +
+ + {t("total_play_time", { amount: formatPlayTime() })} +
- {userProfile.friends.map((friend) => { - return ( - - ); - })} - - {isMe && ( - - )} + {game.iconUrl ? ( + {game.title} + ) : ( + + )} + + ))}
- )} + + {showFriends && ( +
+ + +
+ {userProfile.friends.map((friend) => { + return ( + + ); + })} + + {isMe && ( + + )} +
+
+ )} +
- + )} ); } diff --git a/src/renderer/src/pages/user/user-profile-settings-modal/user-profile-settings-modal.tsx b/src/renderer/src/pages/user/user-profile-settings-modal/user-profile-settings-modal.tsx index 5615cf12..7818b4f8 100644 --- a/src/renderer/src/pages/user/user-profile-settings-modal/user-profile-settings-modal.tsx +++ b/src/renderer/src/pages/user/user-profile-settings-modal/user-profile-settings-modal.tsx @@ -20,7 +20,7 @@ export const UserProfileSettingsModal = ({ }: UserEditProfileModalProps) => { const { t } = useTranslation("user_profile"); - const tabs = [t("edit_profile"), "Ban list"]; + const tabs = [t("edit_profile"), t("blocked_users")]; const [currentTabIndex, setCurrentTabIndex] = useState(0);