mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-13 08:33:01 -04:00
Remove obsolete patches for old profiles (#2800)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
2bdc2f4e82
commit
44c8463496
13 changed files with 23 additions and 291 deletions
|
@ -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,13 +76,6 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
patches: [
|
||||
{
|
||||
find: "showBorder:null",
|
||||
replacement: {
|
||||
match: /user:(\i),setNote:\i,canDM.+?\}\)/,
|
||||
replace: "$&,$self.getReviewsComponent($1)"
|
||||
}
|
||||
},
|
||||
{
|
||||
find: ".BITE_SIZE,user:",
|
||||
replacement: {
|
||||
|
@ -148,31 +139,6 @@ export default definePlugin({
|
|||
}, 4000);
|
||||
},
|
||||
|
||||
getReviewsComponent: ErrorBoundary.wrap((user: User) => {
|
||||
const [reviewCount, setReviewCount] = useState<number>();
|
||||
|
||||
return (
|
||||
<ExpandableHeader
|
||||
headerText="User Reviews"
|
||||
onMoreClick={() => 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}
|
||||
>
|
||||
<ReviewsView
|
||||
discordId={user.id}
|
||||
name={user.username}
|
||||
onFetchReviews={r => setReviewCount(r.reviewCount)}
|
||||
showInput
|
||||
/>
|
||||
</ExpandableHeader>
|
||||
);
|
||||
}, { message: "Failed to render Reviews" }),
|
||||
|
||||
BiteSizeReviewsButton: ErrorBoundary.wrap(({ user }: { user: User; }) => {
|
||||
return (
|
||||
<TooltipContainer text="View Reviews">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue