diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index 53839263..7423cc57 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -20,18 +20,16 @@ import "./style.css"; import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import ErrorBoundary from "@components/ErrorBoundary"; -import { ExpandableHeader } from "@components/ExpandableHeader"; import { NotesIcon, OpenExternalIcon } from "@components/Icons"; import { Devs } from "@utils/constants"; import { classes } from "@utils/misc"; import definePlugin from "@utils/types"; import { findByPropsLazy } from "@webpack"; -import { Alerts, Button, Menu, Parser, TooltipContainer, useState } from "@webpack/common"; +import { Alerts, Button, Menu, Parser, TooltipContainer } from "@webpack/common"; import { Guild, User } from "discord-types/general"; import { Auth, initAuth, updateAuth } from "./auth"; import { openReviewsModal } from "./components/ReviewModal"; -import ReviewsView from "./components/ReviewsView"; import { NotificationType } from "./entities"; import { getCurrentUserInfo, readNotification } from "./reviewDbApi"; import { settings } from "./settings"; @@ -78,28 +76,12 @@ export default definePlugin({ }, patches: [ - { - find: "showBorder:null", - replacement: { - match: /user:(\i),setNote:\i,canDM.+?\}\)/, - replace: "$&,$self.getReviewsComponent($1)" - } - }, - { - find: /inline:!1,profileViewedAnalytics:\i}\),/, - replacement: { - match: /currentUser:\i,guild:\i}\)(?<=user:(\i),bio:null==\i\?.+?)/, - replace: "$&,$self.getReviewsComponent($1)" - }, - predicate: () => !settings.store.preferButtonOverDropdown - }, { find: ".BITE_SIZE,user:", replacement: { match: /{profileType:\i\.\i\.BITE_SIZE,children:\[/, replace: "$&$self.BiteSizeReviewsButton({user:arguments[0].user})," - }, - predicate: () => settings.store.preferButtonOverDropdown + } }, { find: ".FULL_SIZE,user:", @@ -171,31 +153,6 @@ export default definePlugin({ }, 4000); }, - getReviewsComponent: ErrorBoundary.wrap((user: User) => { - const [reviewCount, setReviewCount] = useState(); - - return ( - openReviewsModal(user.id, user.username)} - moreTooltipText={ - reviewCount && reviewCount > 50 - ? `View all ${reviewCount} reviews` - : "Open Review Modal" - } - onDropDownClick={state => settings.store.reviewsDropdownState = !state} - defaultState={settings.store.reviewsDropdownState} - > - setReviewCount(r.reviewCount)} - showInput - /> - - ); - }, { message: "Failed to render Reviews" }), - BiteSizeReviewsButton: ErrorBoundary.wrap(({ user }: { user: User; }) => { return ( @@ -212,4 +169,4 @@ export default definePlugin({ ); }, { noop: true }) -}); +}); \ No newline at end of file diff --git a/src/plugins/reviewDB/settings.tsx b/src/plugins/reviewDB/settings.tsx index b8b02171..c3c806f5 100644 --- a/src/plugins/reviewDB/settings.tsx +++ b/src/plugins/reviewDB/settings.tsx @@ -54,12 +54,6 @@ export const settings = definePluginSettings({ description: "Hide reviews from blocked users", default: true, }, - preferButtonOverDropdown: { - description: "Show a button instead of dropdown to view reviews", - type: OptionType.BOOLEAN, - default: true, - restartNeeded: true - }, buttons: { type: OptionType.COMPONENT, description: "ReviewDB buttons",