mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: profile active subscription
This commit is contained in:
parent
fe681c3af9
commit
5c4ddd9b7a
@ -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
|
||||
|
@ -261,6 +261,7 @@ export interface UserProfile {
|
||||
relation: UserRelation | null;
|
||||
currentGame: UserProfileCurrentGame | null;
|
||||
bio: string;
|
||||
hasActiveSubscription: boolean;
|
||||
}
|
||||
|
||||
export interface UpdateProfileRequest {
|
||||
|
Loading…
Reference in New Issue
Block a user