mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-13 06:37:39 +00:00
Compare commits
6 Commits
fix/archiv
...
fix/friend
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0956b1bc1 | ||
|
|
d9d443ee6d | ||
|
|
a912b57ccc | ||
|
|
447c146035 | ||
|
|
e7a62c16fa | ||
|
|
2ccc93ea61 |
@@ -689,6 +689,7 @@
|
||||
"blocked_users": "Blocked users",
|
||||
"unblock": "Unblock",
|
||||
"no_friends_added": "You have no added friends",
|
||||
"no_friends_yet": "You haven't added any friends yet",
|
||||
"view_all": "View all",
|
||||
"load_more": "Load more",
|
||||
"loading": "Loading",
|
||||
|
||||
@@ -4,6 +4,20 @@
|
||||
&__box {
|
||||
padding: calc(globals.$spacing-unit * 2);
|
||||
position: relative;
|
||||
|
||||
&--empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: calc(globals.$spacing-unit * 2);
|
||||
}
|
||||
}
|
||||
|
||||
&__empty-text {
|
||||
color: globals.$muted-color;
|
||||
font-size: globals.$small-font-size;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__add-friend-button {
|
||||
|
||||
@@ -19,6 +19,7 @@ export function FriendsBox() {
|
||||
const [showAddFriendModal, setShowAddFriendModal] = useState(false);
|
||||
|
||||
const isMe = userDetails?.id === userProfile?.id;
|
||||
const hasFriends = userProfile?.friends && userProfile.friends.length > 0;
|
||||
|
||||
const getGameImage = (game: { iconUrl: string | null; title: string }) => {
|
||||
if (game.iconUrl) {
|
||||
@@ -35,7 +36,15 @@ export function FriendsBox() {
|
||||
return <SteamLogo width={16} height={16} />;
|
||||
};
|
||||
|
||||
if (!userProfile?.friends.length) return null;
|
||||
if (!hasFriends) {
|
||||
if (!isMe) return null;
|
||||
|
||||
return (
|
||||
<div className="friends-box__box friends-box__box--empty">
|
||||
<p className="friends-box__empty-text">{t("no_friends_yet")}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const visibleFriends = userProfile.friends.slice(0, MAX_VISIBLE_FRIENDS);
|
||||
const totalFriends = userProfile.friends.length;
|
||||
|
||||
@@ -376,7 +376,7 @@ export function ProfileContent() {
|
||||
const hasAnyGames = hasGames || hasPinnedGames;
|
||||
|
||||
const shouldShowRightContent =
|
||||
hasAnyGames || userProfile.friends.length > 0;
|
||||
hasAnyGames || userProfile.friends.length > 0 || isMe;
|
||||
|
||||
return (
|
||||
<section className="profile-content__section">
|
||||
@@ -444,7 +444,7 @@ export function ProfileContent() {
|
||||
<RecentGamesBox />
|
||||
</ProfileSection>
|
||||
)}
|
||||
{userProfile?.friends.length > 0 && (
|
||||
{(userProfile?.friends.length > 0 || isMe) && (
|
||||
<ProfileSection
|
||||
title={t("friends")}
|
||||
count={userStats?.friendsCount || userProfile.friends.length}
|
||||
|
||||
63
yarn.lock
63
yarn.lock
@@ -2203,14 +2203,15 @@
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/config-resolver@^4.3.0", "@smithy/config-resolver@^4.3.1":
|
||||
version "4.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/config-resolver/-/config-resolver-4.3.1.tgz#f1a0ed6faa52377909440002e1632be9fc901840"
|
||||
integrity sha512-tWDwrWy37CDVGeaP8AIGZPFL2RoFtmd5Y+nTzLw5qroXNedT2S66EY2d+XzB1zxulCd6nfDXnAQu4auq90aj5Q==
|
||||
version "4.4.5"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/config-resolver/-/config-resolver-4.4.5.tgz#35e792b6db00887bdd029df9b41780ca005d064b"
|
||||
integrity sha512-HAGoUAFYsUkoSckuKbCPayECeMim8pOu+yLy1zOxt1sifzEbrsRpYa+mKcMdiHKMeiqOibyPG0sFJnmaV/OGEg==
|
||||
dependencies:
|
||||
"@smithy/node-config-provider" "^4.3.1"
|
||||
"@smithy/types" "^4.7.0"
|
||||
"@smithy/node-config-provider" "^4.3.7"
|
||||
"@smithy/types" "^4.11.0"
|
||||
"@smithy/util-config-provider" "^4.2.0"
|
||||
"@smithy/util-middleware" "^4.2.1"
|
||||
"@smithy/util-endpoints" "^3.2.7"
|
||||
"@smithy/util-middleware" "^4.2.7"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/core@^3.15.0", "@smithy/core@^3.16.0":
|
||||
@@ -2421,6 +2422,16 @@
|
||||
"@smithy/types" "^4.7.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/node-config-provider@^4.3.7":
|
||||
version "4.3.7"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/node-config-provider/-/node-config-provider-4.3.7.tgz#c023fa857b008c314f621fb5b124724c157b2fd3"
|
||||
integrity sha512-7r58wq8sdOcrwWe+klL9y3bc4GW1gnlfnFOuL7CXa7UzfhzhxKuzNdtqgzmTV+53lEp9NXh5hY/S4UgjLOzPfw==
|
||||
dependencies:
|
||||
"@smithy/property-provider" "^4.2.7"
|
||||
"@smithy/shared-ini-file-loader" "^4.4.2"
|
||||
"@smithy/types" "^4.11.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/node-http-handler@^4.3.0", "@smithy/node-http-handler@^4.4.0":
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/node-http-handler/-/node-http-handler-4.4.0.tgz#e1f6ae4a90cd7257699263bf8e06e653ff0e5f83"
|
||||
@@ -2440,6 +2451,14 @@
|
||||
"@smithy/types" "^4.7.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/property-provider@^4.2.7":
|
||||
version "4.2.7"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/property-provider/-/property-provider-4.2.7.tgz#cd0044e13495cf4064b3a6ed3299e5f549ba7513"
|
||||
integrity sha512-jmNYKe9MGGPoSl/D7JDDs1C8b3dC8f/w78LbaVfoTtWy4xAd5dfjaFG9c9PWPihY4ggMQNQSMtzU77CNgAJwmA==
|
||||
dependencies:
|
||||
"@smithy/types" "^4.11.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/protocol-http@^5.3.0", "@smithy/protocol-http@^5.3.1":
|
||||
version "5.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/protocol-http/-/protocol-http-5.3.1.tgz#add01f73290f1e8fd49d7102b63e3fe53a5e6e18"
|
||||
@@ -2480,6 +2499,14 @@
|
||||
"@smithy/types" "^4.7.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/shared-ini-file-loader@^4.4.2":
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.2.tgz#8fa1b459de485b11185fe8c64182e3205a280ba9"
|
||||
integrity sha512-M7iUUff/KwfNunmrgtqBfvZSzh3bmFgv/j/t1Y1dQ+8dNo34br1cqVEqy6v0mYEgi0DkGO7Xig0AnuOaEGVlcg==
|
||||
dependencies:
|
||||
"@smithy/types" "^4.11.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/signature-v4@^5.3.0":
|
||||
version "5.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/signature-v4/-/signature-v4-5.3.1.tgz#c3d711c29d37f3db4daf51750eea75204c4f51d4"
|
||||
@@ -2507,6 +2534,13 @@
|
||||
"@smithy/util-stream" "^4.5.1"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/types@^4.11.0":
|
||||
version "4.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/types/-/types-4.11.0.tgz#c02f6184dcb47c4f0b387a32a7eca47956cc09f1"
|
||||
integrity sha512-mlrmL0DRDVe3mNrjTcVcZEgkFmufITfUAPBEA+AHYiIeYyJebso/He1qLbP3PssRe22KUzLRpQSdBPbXdgZ2VA==
|
||||
dependencies:
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/types@^4.6.0", "@smithy/types@^4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/types/-/types-4.7.0.tgz#42d707276d9184aef705f04e04615cd1979d044f"
|
||||
@@ -2601,6 +2635,15 @@
|
||||
"@smithy/types" "^4.7.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/util-endpoints@^3.2.7":
|
||||
version "3.2.7"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/util-endpoints/-/util-endpoints-3.2.7.tgz#78cd5dd4aac8d9977f49d256d1e3418a09cade72"
|
||||
integrity sha512-s4ILhyAvVqhMDYREeTS68R43B1V5aenV5q/V1QpRQJkCXib5BPRo4s7uNdzGtIKxaPHCfU/8YkvPAEvTpxgspg==
|
||||
dependencies:
|
||||
"@smithy/node-config-provider" "^4.3.7"
|
||||
"@smithy/types" "^4.11.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/util-hex-encoding@^4.2.0":
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz#1c22ea3d1e2c3a81ff81c0a4f9c056a175068a7b"
|
||||
@@ -2616,6 +2659,14 @@
|
||||
"@smithy/types" "^4.7.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/util-middleware@^4.2.7":
|
||||
version "4.2.7"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/util-middleware/-/util-middleware-4.2.7.tgz#1cae2c4fd0389ac858d29f7170c33b4443e83524"
|
||||
integrity sha512-i1IkpbOae6NvIKsEeLLM9/2q4X+M90KV3oCFgWQI4q0Qz+yUZvsr+gZPdAEAtFhWQhAHpTsJO8DRJPuwVyln+w==
|
||||
dependencies:
|
||||
"@smithy/types" "^4.11.0"
|
||||
tslib "^2.6.2"
|
||||
|
||||
"@smithy/util-retry@^4.2.0", "@smithy/util-retry@^4.2.1":
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@smithy/util-retry/-/util-retry-4.2.1.tgz#8336368586a458cdce86fc92d6fb11fd1db41521"
|
||||
|
||||
Reference in New Issue
Block a user