+
![]()
{
{
!Settings.plugins.ReviewDB.hideTimestamps && (
-
- {dateFormat.format(review.timestamp * 1000)}
- )
+
+ )
}
{review.comment}
diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx
index ff46cca..f4bd248 100644
--- a/src/plugins/reviewDB/components/ReviewsView.tsx
+++ b/src/plugins/reviewDB/components/ReviewsView.tsx
@@ -19,7 +19,7 @@
import { Settings } from "@api/Settings";
import { classes } from "@utils/misc";
import { useAwaiter } from "@utils/react";
-import { findByPropsLazy } from "@webpack";
+import { findLazy } from "@webpack";
import { Forms, React, Text, UserStore } from "@webpack/common";
import type { KeyboardEvent } from "react";
@@ -27,7 +27,7 @@ import { addReview, getReviews } from "../Utils/ReviewDBAPI";
import { authorize, showToast } from "../Utils/Utils";
import ReviewComponent from "./ReviewComponent";
-const Classes = findByPropsLazy("inputDefault", "editable");
+const Classes = findLazy(m => typeof m.textarea === "string");
export default function ReviewsView({ userId }: { userId: string; }) {
const { token } = Settings.plugins.ReviewDB;
@@ -65,7 +65,7 @@ export default function ReviewsView({ userId }: { userId: string; }) {
tag="h2"
variant="eyebrow"
style={{
- marginBottom: "8px",
+ marginBottom: "12px",
color: "var(--header-primary)"
}}
>
@@ -79,17 +79,13 @@ export default function ReviewsView({ userId }: { userId: string; }) {
/>
)}
{reviews?.length === 0 && (
-
+
Looks like nobody reviewed this user yet. You could be the first!
)}
diff --git a/src/plugins/reviewDB/entities/User.ts b/src/plugins/reviewDB/entities/User.ts
index 2c59992..4a3be0e 100644
--- a/src/plugins/reviewDB/entities/User.ts
+++ b/src/plugins/reviewDB/entities/User.ts
@@ -22,23 +22,7 @@ export const enum UserType {
Admin = 1
}
-export interface BanInfo {
- id: string;
- discordID: string;
- reviewID: number;
- reviewContent: string;
- banEndDate: string;
-}
-
export interface ReviewDBUser {
- ID: number
- discordID: string
- username: string
- profilePhoto: string
- clientMod: string
- warningCount: number
- badges: any[]
- banInfo: BanInfo | null
- lastReviewID: number
- type: UserType
+ lastReviewID: number,
+ type: UserType;
}
diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx
index 52ddb3b..0495c77 100644
--- a/src/plugins/reviewDB/index.tsx
+++ b/src/plugins/reviewDB/index.tsx
@@ -22,11 +22,10 @@ import { Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
-import { Alerts, Button } from "@webpack/common";
+import { Button } from "@webpack/common";
import { User } from "discord-types/general";
import ReviewsView from "./components/ReviewsView";
-import { UserType } from "./entities/User";
import { getCurrentUserInfo } from "./Utils/ReviewDBAPI";
import { authorize, showToast } from "./Utils/Utils";
@@ -48,10 +47,10 @@ export default definePlugin({
options: {
authorize: {
type: OptionType.COMPONENT,
- description: "Authorize with ReviewDB",
+ description: "Authorise with ReviewDB",
component: () => (
)
},
@@ -69,29 +68,7 @@ export default definePlugin({
type: OptionType.BOOLEAN,
description: "Hide timestamps on reviews",
default: false,
- },
- website: {
- type: OptionType.COMPONENT,
- description: "ReviewDB website",
- component: () => (
-
- )
- },
- supportServer: {
- type: OptionType.COMPONENT,
- description: "ReviewDB Support Server",
- component: () => (
-
- )
- },
+ }
},
async start() {
@@ -105,34 +82,7 @@ export default definePlugin({
if (user.lastReviewID !== 0)
showToast("You have new reviews on your profile!");
}
-
- if (user.banInfo) {
- const endDate = new Date(user.banInfo.banEndDate);
- if (endDate > new Date() && (settings.user?.banInfo?.banEndDate ?? 0) < endDate) {
-
- Alerts.show({
- title: "You have been banned from ReviewDB",
- body: <>
-
- You are banned from ReviewDB {(user.type === UserType.Banned) ? "permanently" : "until " + endDate.toLocaleString()}
-
-
- Offending Review: {user.banInfo.reviewContent}
-
-
- Continued offenses will result in a permanent ban.
-
- >,
- cancelText: "Appeal",
- confirmText: "Ok",
- onCancel: () => {
- window.open("https://forms.gle/Thj3rDYaMdKoMMuq6");
- }
- });
- }
- }
-
- settings.user = user;
+ settings.userType = user.type;
}, 4000);
},
diff --git a/src/plugins/searchReply.tsx b/src/plugins/searchReply.tsx
index 9e53436..fe6348b 100644
--- a/src/plugins/searchReply.tsx
+++ b/src/plugins/searchReply.tsx
@@ -38,7 +38,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { messag
// dms and group chats
const dmGroup = findGroupChildrenByChildId("pin", children);
if (dmGroup && !dmGroup.some(child => child?.props?.id === "reply")) {
- const pinIndex = dmGroup.findIndex(c => c?.props.id === "pin");
+ const pinIndex = dmGroup.findIndex(c => c.props.id === "pin");
return dmGroup.splice(pinIndex + 1, 0, (
require("../components/VencordSettings").default);
+
export default definePlugin({
name: "Settings",
description: "Adds Settings UI and debug info",
@@ -91,37 +95,37 @@ export default definePlugin({
{
section: "VencordSettings",
label: "Vencord",
- element: require("@components/VencordSettings/VencordTab").default
+ element: () =>
},
{
section: "VencordPlugins",
label: "Plugins",
- element: require("@components/VencordSettings/PluginsTab").default,
+ element: () => ,
},
{
section: "VencordThemes",
label: "Themes",
- element: require("@components/VencordSettings/ThemesTab").default,
+ element: () => ,
},
!IS_WEB && {
section: "VencordUpdater",
label: "Updater",
- element: require("@components/VencordSettings/UpdaterTab").default,
+ element: () => ,
},
{
section: "VencordCloud",
label: "Cloud",
- element: require("@components/VencordSettings/CloudTab").default,
+ element: () => ,
},
{
section: "VencordSettingsSync",
label: "Backup & Restore",
- element: require("@components/VencordSettings/BackupAndRestoreTab").default,
+ element: () => ,
},
IS_DEV && {
section: "VencordPatchHelper",
label: "Patch Helper",
- element: require("@components/VencordSettings/PatchHelperTab").default,
+ element: PatchHelper!,
},
IS_VENCORD_DESKTOP && {
section: "VencordDesktop",
diff --git a/src/plugins/showConnections/VerifiedIcon.tsx b/src/plugins/showConnections/VerifiedIcon.tsx
deleted file mode 100644
index 79e27c4..0000000
--- a/src/plugins/showConnections/VerifiedIcon.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Vencord, a modification for Discord's desktop app
- * Copyright (c) 2023 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 { LazyComponent } from "@utils/react";
-import { findByCode, findLazy } from "@webpack";
-import { i18n, useToken } from "@webpack/common";
-
-const ColorMap = findLazy(m => m.colors?.INTERACTIVE_MUTED?.css);
-const VerifiedIconComponent = LazyComponent(() => findByCode(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP"));
-
-export function VerifiedIcon() {
- const color = useToken(ColorMap.colors.INTERACTIVE_MUTED).hex();
- const forcedIconColor = useToken(ColorMap.colors.INTERACTIVE_ACTIVE).hex();
-
- return (
-
- );
-}
diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx
index 50fcfe1..e2afc5b 100644
--- a/src/plugins/showConnections/index.tsx
+++ b/src/plugins/showConnections/index.tsx
@@ -20,8 +20,6 @@ import "./styles.css";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
-import { Flex } from "@components/Flex";
-import { CopyIcon, LinkIcon } from "@components/Icons";
import { Devs } from "@utils/constants";
import { copyWithToast } from "@utils/misc";
import { LazyComponent } from "@utils/react";
@@ -30,8 +28,6 @@ import { findByCode, findByCodeLazy, findByPropsLazy, findStoreLazy } from "@web
import { Text, Tooltip } from "@webpack/common";
import { User } from "discord-types/general";
-import { VerifiedIcon } from "./VerifiedIcon";
-
const Section = LazyComponent(() => findByCode("().lastSection"));
const UserProfileStore = findStoreLazy("UserProfileStore");
const ThemeStore = findStoreLazy("ThemeStore");
@@ -101,13 +97,7 @@ function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {
>
Connections
-
- {connections.map(connection => )}
-
+ {connections.map(connection => )}
);
}
@@ -121,23 +111,17 @@ function CompactConnectionComponent({ connection, theme }: { connection: Connect
aria-label={connection.name}
src={theme === "light" ? platform.icon.lightSVG : platform.icon.darkSVG}
style={{
+ marginTop: getSpacingPx(settings.store.iconSpacing),
+ marginRight: getSpacingPx(settings.store.iconSpacing),
width: settings.store.iconSize,
height: settings.store.iconSize
}}
/>
);
- const TooltipIcon = url ? LinkIcon : CopyIcon;
-
return (
- {connection.name}
- {connection.verified && }
-
-
- }
+ text={`${connection.name}${!connection.verified ? " (unverified)" : ""}`}
key={connection.id}
>
{tooltipProps =>
diff --git a/src/plugins/showConnections/styles.css b/src/plugins/showConnections/styles.css
index 383593c..71a835b 100644
--- a/src/plugins/showConnections/styles.css
+++ b/src/plugins/showConnections/styles.css
@@ -3,9 +3,3 @@
display: inline-block;
cursor: pointer;
}
-
-.vc-sc-tooltip {
- display: inline-flex;
- gap: 0.25em;
- align-items: center;
-}
diff --git a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
index d01efec..dc670bf 100644
--- a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
+++ b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
@@ -16,18 +16,15 @@
* along with this program. If not, see .
*/
-import { Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { LazyComponent } from "@utils/react";
import { formatDuration } from "@utils/text";
-import { find, findByPropsLazy } from "@webpack";
-import { EmojiStore, FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip, useEffect, useState } from "@webpack/common";
+import { find, findByPropsLazy, findStoreLazy } from "@webpack";
+import { FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip } from "@webpack/common";
import type { Channel } from "discord-types/general";
import type { ComponentType } from "react";
-import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "../../permissionsViewer/components/RolesAndUsersPermissions";
-import { sortPermissionOverwrites } from "../../permissionsViewer/utils";
-import { settings, VIEW_CHANNEL } from "..";
+import { VIEW_CHANNEL } from "..";
enum SortOrderTypes {
LATEST_ACTIVITY = 0,
@@ -95,6 +92,7 @@ const TagComponent = LazyComponent(() => find(m => {
return code.includes(".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG") && !code.includes("increasedActivityPill");
}));
+const EmojiStore = findStoreLazy("EmojiStore");
const EmojiParser = findByPropsLazy("convertSurrogateToName");
const EmojiUtils = findByPropsLazy("getURL", "buildEmojiReactionColorsPlatformed");
@@ -126,9 +124,6 @@ const VideoQualityModesToNames = {
const HiddenChannelLogo = "/assets/433e3ec4319a9d11b0cbe39342614982.svg";
function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
- const [viewAllowedUsersAndRoles, setViewAllowedUsersAndRoles] = useState(settings.store.defaultAllowedUsersAndRolesDropdownState);
- const [permissions, setPermissions] = useState([]);
-
const {
type,
topic,
@@ -145,39 +140,27 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
bitrate,
rtcRegion,
videoQualityMode,
- permissionOverwrites,
- guild_id
+ permissionOverwrites
} = channel;
- useEffect(() => {
- const membersToFetch: Array = [];
+ const membersToFetch: Array = [];
- const guildOwnerId = GuildStore.getGuild(guild_id).ownerId;
- if (!GuildMemberStore.getMember(guild_id, guildOwnerId)) membersToFetch.push(guildOwnerId);
+ const guildOwnerId = GuildStore.getGuild(channel.guild_id).ownerId;
+ if (!GuildMemberStore.getMember(channel.guild_id, guildOwnerId)) membersToFetch.push(guildOwnerId);
- Object.values(permissionOverwrites).forEach(({ type, id: userId }) => {
- if (type === 1 && !GuildMemberStore.getMember(guild_id, userId)) {
- membersToFetch.push(userId);
- }
+ Object.values(permissionOverwrites).forEach(({ type, id: userId }) => {
+ if (type === 1) {
+ if (!GuildMemberStore.getMember(channel.guild_id, userId)) membersToFetch.push(userId);
+ }
+ });
+
+ if (membersToFetch.length > 0) {
+ FluxDispatcher.dispatch({
+ type: "GUILD_MEMBERS_REQUEST",
+ guildIds: [channel.guild_id],
+ userIds: membersToFetch
});
-
- if (membersToFetch.length > 0) {
- FluxDispatcher.dispatch({
- type: "GUILD_MEMBERS_REQUEST",
- guildIds: [guild_id],
- userIds: membersToFetch
- });
- }
-
- if (Settings.plugins.PermissionsViewer.enabled) {
- setPermissions(sortPermissionOverwrites(Object.values(permissionOverwrites).map(overwrite => ({
- type: overwrite.type as PermissionType,
- id: overwrite.id,
- overwriteAllow: overwrite.allow,
- overwriteDeny: overwrite.deny
- })), guild_id));
- }
- }, [channelId]);
+ }
return (
@@ -199,7 +182,7 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
aria-hidden={true}
role="img"
>
-
+
)}
@@ -209,7 +192,7 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
{(!channel.isGuildVoice() && !channel.isGuildStageVoice()) && (
You can not see the {channel.isForumChannel() ? "posts" : "messages"} of this channel.
- {channel.isForumChannel() && topic && topic.length > 0 && " However you may see its guidelines:"}
+ {channel.isForumChannel() && topic && topic.length > 0 && "However you may see its guidelines:"}
)}
@@ -285,49 +268,8 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
}
-
- {Settings.plugins.PermissionsViewer.enabled && (
-
- {({ onMouseLeave, onMouseEnter }) => (
-
- )}
-
- )}
-
Allowed users and roles:
-
- {({ onMouseLeave, onMouseEnter }) => (
-
- )}
-
-
- {viewAllowedUsersAndRoles &&
}
+
Allowed users and roles:
+