mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 08:43:48 +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 { UserGame } from "@types";
|
||||||
import {
|
import {
|
||||||
buildGameAchievementPath,
|
buildGameAchievementPath,
|
||||||
|
buildGameDetailsPath,
|
||||||
formatDownloadProgress,
|
formatDownloadProgress,
|
||||||
} from "@renderer/helpers";
|
} from "@renderer/helpers";
|
||||||
import { MAX_MINUTES_TO_SHOW_IN_PLAYTIME } from "@renderer/constants";
|
import { MAX_MINUTES_TO_SHOW_IN_PLAYTIME } from "@renderer/constants";
|
||||||
@ -45,11 +46,12 @@ export function ProfileContent() {
|
|||||||
}, [userProfile]);
|
}, [userProfile]);
|
||||||
|
|
||||||
const buildUserGameDetailsPath = (game: UserGame) => {
|
const buildUserGameDetailsPath = (game: UserGame) => {
|
||||||
// TODO: check if user has hydra cloud
|
if (!userProfile?.hasActiveSubscription) {
|
||||||
// buildGameDetailsPath({
|
return buildGameDetailsPath({
|
||||||
// ...game,
|
...game,
|
||||||
// objectId: game.objectId,
|
objectId: game.objectId,
|
||||||
// });
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const userParams = userProfile
|
const userParams = userProfile
|
||||||
? {
|
? {
|
||||||
@ -172,6 +174,7 @@ export function ProfileContent() {
|
|||||||
{formatPlayTime(game.playTimeInSeconds)}
|
{formatPlayTime(game.playTimeInSeconds)}
|
||||||
</small>
|
</small>
|
||||||
|
|
||||||
|
{userProfile.hasActiveSubscription && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
color: "white",
|
color: "white",
|
||||||
@ -219,6 +222,7 @@ export function ProfileContent() {
|
|||||||
className={styles.achievementsProgressBar}
|
className={styles.achievementsProgressBar}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
|
@ -261,6 +261,7 @@ export interface UserProfile {
|
|||||||
relation: UserRelation | null;
|
relation: UserRelation | null;
|
||||||
currentGame: UserProfileCurrentGame | null;
|
currentGame: UserProfileCurrentGame | null;
|
||||||
bio: string;
|
bio: string;
|
||||||
|
hasActiveSubscription: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateProfileRequest {
|
export interface UpdateProfileRequest {
|
||||||
|
Loading…
Reference in New Issue
Block a user