feat: profile active subscription

This commit is contained in:
Zamitto 2024-10-16 01:08:10 -03:00
parent fe681c3af9
commit 5c4ddd9b7a
2 changed files with 41 additions and 36 deletions

View File

@ -17,6 +17,7 @@ import { RecentGamesBox } from "./recent-games-box";
import { UserGame } from "@types";
import {
buildGameAchievementPath,
buildGameDetailsPath,
formatDownloadProgress,
} from "@renderer/helpers";
import { MAX_MINUTES_TO_SHOW_IN_PLAYTIME } from "@renderer/constants";
@ -45,11 +46,12 @@ export function ProfileContent() {
}, [userProfile]);
const buildUserGameDetailsPath = (game: UserGame) => {
// TODO: check if user has hydra cloud
// buildGameDetailsPath({
// ...game,
// objectId: game.objectId,
// });
if (!userProfile?.hasActiveSubscription) {
return buildGameDetailsPath({
...game,
objectId: game.objectId,
});
}
const userParams = userProfile
? {
@ -172,6 +174,7 @@ export function ProfileContent() {
{formatPlayTime(game.playTimeInSeconds)}
</small>
{userProfile.hasActiveSubscription && (
<div
style={{
color: "white",
@ -219,6 +222,7 @@ export function ProfileContent() {
className={styles.achievementsProgressBar}
/>
</div>
)}
</div>
<img

View File

@ -261,6 +261,7 @@ export interface UserProfile {
relation: UserRelation | null;
currentGame: UserProfileCurrentGame | null;
bio: string;
hasActiveSubscription: boolean;
}
export interface UpdateProfileRequest {