Skip to content
This repository has been archived by the owner on Feb 21, 2025. It is now read-only.

Commit

Permalink
Merge pull request #121 from game-node-app/dev
Browse files Browse the repository at this point in the history
- re-enables GameInfoPlaytime component
  • Loading branch information
Lamarcke authored Oct 26, 2024
2 parents 62a53b2 + a4712bd commit 4a6e06f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/components/game/info/GameInfoDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Center, SimpleGrid, Stack } from "@mantine/core";
import { Game, GameRepositoryFindOneDto } from "@/wrapper/server";
import { SimpleGrid, Stack } from "@mantine/core";
import { Game } from "@/wrapper/server";
import { getLocalizedFirstReleaseDate } from "@/components/game/util/getLocalizedFirstReleaseDate";
import { DetailsBox } from "@/components/general/DetailsBox";
import GameInfoPlatforms from "@/components/game/info/GameInfoPlatforms";
Expand Down Expand Up @@ -48,6 +48,7 @@ const GameInfoDetails = ({ game }: IGameInfoDetailsProps) => {
<GameInfoProgressTimeline gameId={game.id} />
</DetailsBox>
<GameInfoScore gameId={game.id} />
<GameInfoPlaytime gameId={game.id} />
</SimpleGrid>
</Stack>
);
Expand Down
20 changes: 15 additions & 5 deletions src/components/game/info/playtime/GameInfoPlaytime.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";
import { useQuery } from "@tanstack/react-query";
import { SyncHltbService } from "@/wrapper/server";
import { DetailsBox } from "@/components/general/DetailsBox";
import GameInfoPlaytimeItem from "@/components/game/info/playtime/GameInfoPlaytimeItem";
import { Space, Stack, Text } from "@mantine/core";
import CenteredLoading from "@/components/general/CenteredLoading";
import TextLink from "@/components/general/TextLink";
import { PlaytimeService } from "@/wrapper/server";

interface Props {
gameId: number;
Expand All @@ -14,7 +14,7 @@ const GameInfoPlaytime = ({ gameId }: Props) => {
const playtimeQuery = useQuery({
queryKey: ["game", "playtime", gameId],
queryFn: () => {
return SyncHltbService.hltbControllerFindPlaytimeForGameId(gameId);
return PlaytimeService.playtimeControllerFindOneByGameId(gameId);
},
enabled: !!gameId,
staleTime: Infinity,
Expand All @@ -23,7 +23,7 @@ const GameInfoPlaytime = ({ gameId }: Props) => {
const playtime = playtimeQuery.data;
return (
<DetailsBox
title={"Playtime"}
title={"Estimated playtime"}
withBorder
withDimmedTitle
stackProps={{
Expand All @@ -48,7 +48,17 @@ const GameInfoPlaytime = ({ gameId }: Props) => {
value={playtime?.time100}
/>
<Text className={"text-center text-xs mt-4"} c={"dimmed"}>
Data provided by <a href={"https://howlongtobeat.com"}>HLTB</a>
Data provided by{" "}
<TextLink
fz={"sm"}
span
href={"https://howlongtobeat.com"}
linkProps={{
target: "_blank",
}}
>
HLTB
</TextLink>
</Text>
</DetailsBox>
);
Expand Down
2 changes: 0 additions & 2 deletions src/components/general/input/select/SelectWithOrdering.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const SelectWithOrdering = ({
"ASC" | "DESC"
>("DESC");

console.log(internalSelectedItem, internalSelectedOrdering);

return (
<Select
{...others}
Expand Down
2 changes: 1 addition & 1 deletion src/wrapper/input/server_swagger.json

Large diffs are not rendered by default.

0 comments on commit 4a6e06f

Please sign in to comment.