mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-13 03:32:13 +00:00
feat: adding link to game running
This commit is contained in:
parent
8afb3c27dc
commit
2f4d1396a9
3 changed files with 26 additions and 19 deletions
|
@ -4,8 +4,8 @@ import { dataSource } from "@main/data-source";
|
|||
import { DownloadQueue, Game, UserAuth } from "@main/entity";
|
||||
|
||||
const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||
const databaseOperations = dataSource.transaction(
|
||||
async (transactionalEntityManager) => {
|
||||
const databaseOperations = dataSource
|
||||
.transaction(async (transactionalEntityManager) => {
|
||||
await transactionalEntityManager.getRepository(DownloadQueue).delete({});
|
||||
|
||||
await transactionalEntityManager.getRepository(Game).delete({});
|
||||
|
@ -13,11 +13,11 @@ const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
|
|||
await transactionalEntityManager
|
||||
.getRepository(UserAuth)
|
||||
.delete({ id: 1 });
|
||||
}
|
||||
);
|
||||
|
||||
/* Removes all games being played */
|
||||
gamesPlaytime.clear();
|
||||
})
|
||||
.then(() => {
|
||||
/* Removes all games being played */
|
||||
gamesPlaytime.clear();
|
||||
});
|
||||
|
||||
/* Disconnects aria2 */
|
||||
DownloadManager.disconnect();
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import { buildGameDetailsPath, steamUrlBuilder } from "@renderer/helpers";
|
||||
import { PersonIcon, TelescopeIcon } from "@primer/octicons-react";
|
||||
import { Button } from "@renderer/components";
|
||||
import { Button, Link } from "@renderer/components";
|
||||
import { UserEditProfileModal } from "./user-edit-modal";
|
||||
import { UserSignOutModal } from "./user-signout-modal";
|
||||
|
||||
|
@ -114,16 +114,11 @@ export function UserContent({
|
|||
}}
|
||||
>
|
||||
{gameRunning && isMe && (
|
||||
<div
|
||||
style={{
|
||||
backgroundImage: `url(${steamUrlBuilder.libraryHero(gameRunning.objectID)})`,
|
||||
backgroundPosition: "top",
|
||||
position: "absolute",
|
||||
inset: 0,
|
||||
backgroundSize: "cover",
|
||||
borderRadius: "4px",
|
||||
}}
|
||||
></div>
|
||||
<img
|
||||
src={steamUrlBuilder.libraryHero(gameRunning.objectID)}
|
||||
alt={gameRunning.title}
|
||||
className={styles.profileBackground}
|
||||
/>
|
||||
)}
|
||||
|
||||
<div
|
||||
|
@ -165,7 +160,9 @@ export function UserContent({
|
|||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<p>{gameRunning.title}</p>
|
||||
<Link to={buildGameDetailsPath(gameRunning)}>
|
||||
{gameRunning.title}
|
||||
</Link>
|
||||
</div>
|
||||
<small>
|
||||
{t("playing_for", {
|
||||
|
|
|
@ -205,3 +205,13 @@ export const signOutModalButtonsContainer = style({
|
|||
gap: `${SPACING_UNIT}px`,
|
||||
paddingTop: `${SPACING_UNIT}px`,
|
||||
});
|
||||
|
||||
export const profileBackground = style({
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
objectFit: "cover",
|
||||
left: "0",
|
||||
top: "0",
|
||||
borderRadius: "4px",
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue