From 6210d3a5974b9c59d7753875c16cd38af7072356 Mon Sep 17 00:00:00 2001 From: Snare-Hawk <85657152+Snare-Hawk@users.noreply.github.com> Date: Thu, 24 Nov 2022 08:26:18 -0500 Subject: [PATCH] Make ReviewDB Look More Native (#256) --- .../reviewDB/components/ReviewComponent.tsx | 15 ++-- .../reviewDB/components/ReviewsView.tsx | 75 ++++++++++--------- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/src/plugins/reviewDB/components/ReviewComponent.tsx b/src/plugins/reviewDB/components/ReviewComponent.tsx index 058ac4cfc..ecd12dacd 100644 --- a/src/plugins/reviewDB/components/ReviewComponent.tsx +++ b/src/plugins/reviewDB/components/ReviewComponent.tsx @@ -71,34 +71,37 @@ export default LazyComponent(() => { body: "Do you really you want to report this review?", confirmText: "Report", cancelText: "Nevermind", - confirmColor: "red", + // confirmColor: "red", this just adds a class name and breaks the submit button guh onConfirm: () => reportReview(review.id) }); } return ( -
+
openModal()} > {review.username}

{review.comment}

-
-
+
+
{canDeleteReview(review, UserStore.getCurrentUser().id) && ( diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 9fe7b9ee4..363b6249a 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -18,8 +18,8 @@ import type { KeyboardEvent } from "react"; -import { lazyWebpack, useAwaiter } from "../../../utils/misc"; -import { Forms, Text } from "../../../webpack/common"; +import { classes, lazyWebpack, useAwaiter } from "../../../utils/misc"; +import { Forms, Text, UserStore } from "../../../webpack/common"; import { addReview, getReviews } from "../Utils/ReviewDBAPI"; import ReviewComponent from "./ReviewComponent"; @@ -46,38 +46,45 @@ export default function ReviewsView({ userId }: { userId: string; }) { } return ( - <> - - User Reviews - - {reviews?.map(review => - + <> + + User Reviews + + {reviews?.map(review => + + )} + {reviews?.length === 0 && ( + + Looks like nobody reviewed this user yet. You could be the first! + + )} +