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 #119 from game-node-app/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Lamarcke authored Oct 22, 2024
2 parents 4e3cfab + 16febbb commit 18475f0
Show file tree
Hide file tree
Showing 13 changed files with 350 additions and 103 deletions.
2 changes: 1 addition & 1 deletion src/components/achievement/hooks/useAchievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Props {

export function useAchievements({ offset = 0, limit = 1000 }: Props) {
return useQuery({
queryKey: ["achievements"],
queryKey: ["achievements", offset, limit],
queryFn: () => {
return AchievementsService.achievementsControllerGetAchievements(
offset,
Expand Down
12 changes: 8 additions & 4 deletions src/components/activity/item/ReviewActivityItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ const ReviewActivityItem = ({ activity }: Props) => {
createdAtDate={activity.createdAt}
/>

<GameRating
value={reviewQuery.data?.rating}
size={"md"}
/>
<Link
href={`/game/${gameQuery.data?.id}?reviewId=${activity.reviewId}`}
>
<GameRating
value={reviewQuery.data?.rating}
size={"md"}
/>
</Link>

<Group>
<ActivityItemLikes activity={activity} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ const AchievementsGenerateCodeView = () => {
},
);

console.log("Generated achievement code: ", resp);

setGeneratedAchievementCode(resp.code);

return resp;
Expand Down
2 changes: 0 additions & 2 deletions src/components/collection/view/CollectionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ const CollectionView = ({
collectionEntriesQuery.isError ||
gamesQuery.isError;

console.log(orderBy);

return (
<Container fluid p={0} h={"100%"}>
{collection && profile && (
Expand Down
19 changes: 1 addition & 18 deletions src/components/game/figure/GameGridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,9 @@ const GameGridItem = ({
figureProps,
withQuickAdd = true,
}: IGameGridFigureProps) => {
const categoryText = useMemo(
() => getGameCategoryName(game?.category),
[game],
);

const Figure = withQuickAdd ? GameFigureWithQuickAdd : GameFigureImage;

return (
<Figure {...figureProps} game={game} href={`/game/${game?.id}`}>
{categoryText && (
<Badge
className={
"!absolute !w-fit !max-w-fit !max-h-fit !h-fit bg-gray-800 ml-1 mt-1"
}
>
{categoryText}
</Badge>
)}
</Figure>
);
return <Figure {...figureProps} game={game} href={`/game/${game?.id}`} />;
};

export default GameGridItem;
20 changes: 2 additions & 18 deletions src/components/game/figure/GameListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,9 @@ const GameListItem = ({
name = name.substring(0, 30) + "...";
}
}
const platformInfo = getGamePlatformInfo(game);
const platformsAbbreviations =
platformInfo.platformsAbbreviations?.join(", ");

const genres = getGameGenres(game);
const genreNames = genres?.join(", ");
const categoryText = useMemo(
() => getGameCategoryName(game?.category),
[game.category],
);

const Figure = withQuickAdd ? GameFigureWithQuickAdd : GameFigureImage;

Expand All @@ -77,17 +71,7 @@ const GameListItem = ({
},
}}
{...figureProps}
>
{categoryText && (
<Badge
className={
"!absolute !w-fit !max-w-fit !max-h-fit !h-fit bg-gray-800 ml-1 mt-1"
}
>
{categoryText}
</Badge>
)}
</Figure>
/>
</Box>
<Stack
h={"100%"}
Expand Down
2 changes: 0 additions & 2 deletions src/components/game/info/review/GameInfoReviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ const GameInfoReviewList = ({ gameId }: IGameInfoReviewListProps) => {
trendingReviewsQuery.data.pagination.hasNextPage) ||
offset > 0;

console.log(shouldShowPagination);

const handlePagination = (page: number) => {
const offset = (page - 1) * DEFAULT_LIMIT;
const updatedDto: FindStatisticsTrendingReviewsDto = {
Expand Down
36 changes: 26 additions & 10 deletions src/components/general/card/ReviewCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import React from "react";
import { Button, Group, Overlay, Paper, Skeleton, Text } from "@mantine/core";
import {
Box,
Button,
Group,
Overlay,
Paper,
Skeleton,
Text,
} from "@mantine/core";
import classes from "./ReviewCard.module.css";
import { UserAvatarGroup } from "@/components/general/avatar/UserAvatarGroup";
import useOnMobile from "@/components/general/hooks/useOnMobile";
Expand All @@ -10,6 +18,7 @@ import {
ImageSize,
} from "@/components/game/util/getSizedImageUrl";
import Link from "next/link";
import GameRating from "@/components/general/input/GameRating";

interface IProps {
reviewId: string;
Expand All @@ -35,17 +44,14 @@ const ReviewCard = ({ reviewId }: IProps) => {

if (reviewQuery.isLoading || gameQuery.isLoading) {
return <Skeleton h={"100%"} />;
} else if (
reviewQuery.data == undefined ||
reviewQuery.data.content == undefined ||
gameQuery.data == undefined
) {
} else if (reviewQuery.data == undefined || gameQuery.data == undefined) {
return null;
}

const profileUserId = reviewQuery.data?.profileUserId;

const strippedContent = reviewQuery.data.content.replace(
// Removes HTML tags from text
const strippedContent = reviewQuery.data.content?.replace(
/(<([^>]+)>)/gi,
"",
);
Expand All @@ -67,10 +73,20 @@ const ReviewCard = ({ reviewId }: IProps) => {
}
>
<Overlay color="#000" backgroundOpacity={0.7} className={"z-10"} />
<div className="z-20 relative">
<Group justify={"start"}>
<UserAvatarGroup userId={profileUserId} />
<div className="z-20 relative w-full">
<Group className={"w-full justify-between flex-nowrap"}>
<Box className={"max-w-64"}>
<UserAvatarGroup
avatarProps={{
size: "lg",
}}
userId={profileUserId}
/>
</Box>

<GameRating value={reviewQuery.data.rating} size={"lg"} />
</Group>

<Text lineClamp={onMobile ? 8 : 10} className={classes.title}>
{strippedContent}
</Text>
Expand Down
3 changes: 1 addition & 2 deletions src/components/general/hooks/useMatomoTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export function useMatomoTracker() {
<Stack className={"w-full items-start"}>
<Text>
We use cookies and similar storage methods to keep track
of your session and how you are using our website. We do
not use third-party cookies.
of your session and how you are using our website.
</Text>
<Flex className={"w-full justify-end"}>
<Group>
Expand Down
1 change: 1 addition & 0 deletions src/components/general/shell/GlobalShellFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type IFooterLink = { href: string; label: string; external?: boolean };
const links: IFooterLink[] = [
{ label: "About", href: "/about" },
{ label: "Privacy", href: "/privacy" },
{ label: "Terms of Service", href: "/tos" },
{
label: "Donate",
href: "https://patreon.com/GameNodeApp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ const ProfileStatsDistributionRadarByType = ({ userId, by }: Props) => {

const data = metricsDistributionQuery.data;

console.log(data, data != undefined);

return (
<>
{metricsDistributionQuery.isLoading && <CenteredLoading />}
Expand Down
Loading

0 comments on commit 18475f0

Please sign in to comment.