Skip to content

Commit

Permalink
Merge pull request #114 from game-node-app/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Lamarcke authored Sep 14, 2024
2 parents f60d0ca + cd65279 commit 36ea12b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
12 changes: 12 additions & 0 deletions src/components/game/info/review/GameInfoReviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,22 @@ const GameInfoReviewList = ({ gameId }: IGameInfoReviewListProps) => {
?.filter((review) => {
return review.profileUserId !== ownUserId;
})
// Give priority to reviews with content
.toSorted((a, b) => {
if (a.content == null) {
return 1;
} else if (b.content == null) {
return -1;
}

return 0;
})
.map((review) => {
return <ReviewListItem key={review.id} review={review} />;
});

debugger;

if (reviews == undefined || reviews.length === 0) {
return (
<Text className={"text-center"}>
Expand Down
19 changes: 9 additions & 10 deletions src/components/review/view/ReviewListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ const ReviewListItem = ({
size={isScoreOnlyReview ? "lg" : "md"}
/>
</Flex>
<Stack className={`w-full lg:mt-auto lg:justify-end`}>
<Stack
className={`w-full lg:justify-end ${isScoreOnlyReview ? "lg:mt-auto" : ""}`}
>
{isScoreOnlyReview ? null : (
<EditorContent
editor={nonEditableEditor}
Expand All @@ -121,15 +123,12 @@ const ReviewListItem = ({
<Group justify={withGameInfo ? "space-between" : "end"}>
{withGameInfo && gameQuery.data != undefined && (
<Box className={"w-6/12 lg:w-4/12"}>
<Text>
on
<TextLink
href={`/game/${gameQuery.data?.id}`}
c={"dimmed"}
>
{gameQuery.data?.name}
</TextLink>
</Text>
<TextLink
href={`/game/${gameQuery.data?.id}`}
c={"dimmed"}
>
{gameQuery.data?.name}
</TextLink>
</Box>
)}
<Group>
Expand Down

0 comments on commit 36ea12b

Please sign in to comment.