From b7782a084ee0dad378d7c406b49e0961653d8df2 Mon Sep 17 00:00:00 2001
From: Manti <67705577+mantikafasi@users.noreply.github.com>
Date: Mon, 21 Nov 2022 23:24:05 +0300
Subject: [PATCH] make some changes in design and add badges to userreviews
---
src/plugins/bypassAutomod.ts | 27 +++++++++++++++++++
.../reviewDB/components/ReviewBadge.tsx | 25 +++++++++++++++++
.../reviewDB/components/ReviewComponent.tsx | 26 ++++++++++++------
.../reviewDB/components/ReviewsView.tsx | 10 ++++---
src/plugins/reviewDB/entities/Badge.ts | 6 +++++
src/plugins/reviewDB/entities/Review.ts | 3 +++
6 files changed, 85 insertions(+), 12 deletions(-)
create mode 100644 src/plugins/bypassAutomod.ts
create mode 100644 src/plugins/reviewDB/components/ReviewBadge.tsx
create mode 100644 src/plugins/reviewDB/entities/Badge.ts
diff --git a/src/plugins/bypassAutomod.ts b/src/plugins/bypassAutomod.ts
new file mode 100644
index 000000000..145c28e7a
--- /dev/null
+++ b/src/plugins/bypassAutomod.ts
@@ -0,0 +1,27 @@
+import { Devs } from "../utils/constants";
+import definePlugin from "../utils/types";
+import { addPreEditListener, addPreSendListener, MessageObject, removePreEditListener, removePreSendListener } from "../api/MessageEvents";
+
+
+export default definePlugin({
+ name: "Bypass Automod",
+ description: "Bypasses the automod",
+ version: "1.0.0",
+ authors: [Devs.mantikafasi],
+ start() {
+ return
+
+ addPreSendListener((_, msg) => {
+ var newMsg = "";
+ msg.content.split(" ").forEach((word, _) => {
+ if (word.length < 2) return
+ let i = Math.round(Math.random() * (word.length - 1));
+ console.log(i,word)
+ newMsg += word.replace(word[i], word[i] + "\u200C\u2062\u2063\u2064\u200d") + " ";
+ });
+ msg.content = newMsg.concat();
+ });
+
+ }
+}
+);
diff --git a/src/plugins/reviewDB/components/ReviewBadge.tsx b/src/plugins/reviewDB/components/ReviewBadge.tsx
new file mode 100644
index 000000000..a290f8af7
--- /dev/null
+++ b/src/plugins/reviewDB/components/ReviewBadge.tsx
@@ -0,0 +1,25 @@
+import { IpcEvents } from "../../../utils";
+import { Tooltip } from "../../../webpack/common";
+
+import Badge from "../entities/Badge";
+
+export default function ReviewBadge(badge: Badge) {
+ return (
+
+ VencordNative.ipc.invoke(IpcEvents.OPEN_EXTERNAL, badge.redirect_url)
+ }
+ />
+ )}
+
{review.comment}
diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 9fe7b9ee4..17a5dcbc0 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -51,7 +51,6 @@ export default function ReviewsView({ userId }: { userId: string; }) { tag="h2" variant="eyebrow" style={{ - paddingLeft: "12px", marginBottom: "12px", color: "var(--header-primary)" }} @@ -66,16 +65,19 @@ export default function ReviewsView({ userId }: { userId: string; }) { /> )} {reviews?.length === 0 && ( -