diff --git a/src/plugins/reviewDB/components/ReviewBadge.tsx b/src/plugins/reviewDB/components/ReviewBadge.tsx new file mode 100644 index 000000000..4a3c0c4c1 --- /dev/null +++ b/src/plugins/reviewDB/components/ReviewBadge.tsx @@ -0,0 +1,45 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { MaskedLinkStore, Tooltip } from "@webpack/common"; + +import { Badge } from "../entities/Badge"; + +export default function ReviewBadge(badge: Badge) { + return ( + + {({ onMouseEnter, onMouseLeave }) => ( + {badge.badge_description} + MaskedLinkStore.openUntrustedLink({ + href: badge.redirect_url, + }) + } + /> + )} + + ); +} diff --git a/src/plugins/reviewDB/components/ReviewComponent.tsx b/src/plugins/reviewDB/components/ReviewComponent.tsx index 8808ccd5f..ddb49223d 100644 --- a/src/plugins/reviewDB/components/ReviewComponent.tsx +++ b/src/plugins/reviewDB/components/ReviewComponent.tsx @@ -24,6 +24,7 @@ import { Review } from "../entities/Review"; import { deleteReview, reportReview } from "../Utils/ReviewDBAPI"; import { canDeleteReview, openUserProfileModal, showToast } from "../Utils/Utils"; import MessageButton from "./MessageButton"; +import ReviewBadge from "./ReviewBadge"; export default LazyComponent(() => { // this is terrible, blame mantika @@ -78,24 +79,32 @@ export default LazyComponent(() => { } return ( -
-
+
+ +
openModal()} > {review.username} + {review.badges.map(badge => )}

{review.comment}

diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 57f974e72..4852967a3 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -54,44 +54,40 @@ export default function ReviewsView({ userId }: { userId: string; }) { return (
- <> - - User Reviews - - {reviews?.map(review => - - )} - {reviews?.length === 0 && ( - - Looks like nobody reviewed this user yet. You could be the first! - - )} -