mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
feat: use convertSteamGameToCatalogueEntry
This commit is contained in:
parent
56f0439aaf
commit
3f0a1207e9
@ -4,6 +4,7 @@ import { logger } from "@main/services";
|
|||||||
import { HydraApi } from "@main/services/hydra-api";
|
import { HydraApi } from "@main/services/hydra-api";
|
||||||
import { steamGamesWorker } from "@main/workers";
|
import { steamGamesWorker } from "@main/workers";
|
||||||
import { UserProfile } from "@types";
|
import { UserProfile } from "@types";
|
||||||
|
import { convertSteamGameToCatalogueEntry } from "../helpers/search-games";
|
||||||
|
|
||||||
const getUserProfile = async (
|
const getUserProfile = async (
|
||||||
_event: Electron.IpcMainInvokeEvent,
|
_event: Electron.IpcMainInvokeEvent,
|
||||||
@ -19,7 +20,7 @@ const getUserProfile = async (
|
|||||||
name: "getById",
|
name: "getById",
|
||||||
});
|
});
|
||||||
|
|
||||||
return { ...game, title: steamGame.name, objectId: game.objectId };
|
return convertSteamGameToCatalogueEntry(steamGame);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ const getUserProfile = async (
|
|||||||
const steamGame = await steamGamesWorker.run(Number(game.objectId), {
|
const steamGame = await steamGamesWorker.run(Number(game.objectId), {
|
||||||
name: "getById",
|
name: "getById",
|
||||||
});
|
});
|
||||||
return { ...game, title: steamGame.name, objectID: game.objectId };
|
return convertSteamGameToCatalogueEntry(steamGame);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export const ProfileContent = ({ userProfile }: ProfileContentProps) => {
|
|||||||
<section className={styles.profileContentBox}>
|
<section className={styles.profileContentBox}>
|
||||||
<img
|
<img
|
||||||
className={styles.profileAvatar}
|
className={styles.profileAvatar}
|
||||||
src="https://avatars.githubusercontent.com/u/167933696?v=4"
|
src="https://cdn.losbroxas.org/3918aa27-9b96-4fdf-b066-4c545d6667ab.png"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={styles.profileInformation}>
|
<div className={styles.profileInformation}>
|
||||||
@ -53,7 +53,12 @@ export const ProfileContent = ({ userProfile }: ProfileContentProps) => {
|
|||||||
style={{ flexDirection: "column" }}
|
style={{ flexDirection: "column" }}
|
||||||
>
|
>
|
||||||
{userProfile.recentGames.map((game) => {
|
{userProfile.recentGames.map((game) => {
|
||||||
return <p key={game.objectID}>{game.title}</p>;
|
return (
|
||||||
|
<>
|
||||||
|
<img src={game.cover} width={50} height={50} />
|
||||||
|
<p key={game.objectID}>{game.title}</p>
|
||||||
|
</>
|
||||||
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -84,7 +89,12 @@ export const ProfileContent = ({ userProfile }: ProfileContentProps) => {
|
|||||||
style={{ flexDirection: "column" }}
|
style={{ flexDirection: "column" }}
|
||||||
>
|
>
|
||||||
{userProfile.libraryGames.map((game) => {
|
{userProfile.libraryGames.map((game) => {
|
||||||
return <p key={game.objectID}>{game.title}</p>;
|
return (
|
||||||
|
<>
|
||||||
|
<img src={game.cover} width={50} height={50} />{" "}
|
||||||
|
<p key={game.objectID}>{game.title}</p>
|
||||||
|
</>
|
||||||
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user