split things around
This commit is contained in:
parent
60cd50efaf
commit
a6eca3f768
2 changed files with 22 additions and 15 deletions
17
index.tsx
17
index.tsx
|
@ -6,23 +6,11 @@
|
||||||
|
|
||||||
import "./style.css";
|
import "./style.css";
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findComponentByCodeLazy } from "@webpack";
|
|
||||||
import { ChannelStore, DateUtils, GuildStore, IconUtils, NavigationRouter, Popout, SnowflakeUtils, Text, UserStore, useStateFromStores } from "@webpack/common";
|
import { ChannelStore, DateUtils, GuildStore, IconUtils, NavigationRouter, Popout, SnowflakeUtils, Text, UserStore, useStateFromStores } from "@webpack/common";
|
||||||
import { Guild } from "discord-types/general";
|
|
||||||
|
|
||||||
const ServerProfileComponent = findComponentByCodeLazy("{guildProfile:v,fetchGuildProfile:O,fetchStatus:I}");
|
import { ArrowSvg, checkForIconExistence, cl, ServerProfileComponent } from "./utils";
|
||||||
const cl = classNameFactory("vc-serverprofileforward-");
|
|
||||||
|
|
||||||
const ArrowSvg = () => <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 24 24"><path fill="var(--text-low-contrast)" d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z" className=""></path></svg>;
|
|
||||||
|
|
||||||
const checkForIconExistence = (guild: Guild) => {
|
|
||||||
if (!guild) return false;
|
|
||||||
if (!guild.icon) return false;
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "MoreForwardMeta",
|
name: "MoreForwardMeta",
|
||||||
|
@ -64,11 +52,10 @@ export default definePlugin({
|
||||||
- Voice channel
|
- Voice channel
|
||||||
- Announcement channel
|
- Announcement channel
|
||||||
- Stage channel
|
- Stage channel
|
||||||
- Directory channel
|
|
||||||
- Forum channel
|
- Forum channel
|
||||||
- Media channel
|
- Media channel
|
||||||
*/
|
*/
|
||||||
if ([0, 2, 5, 13, 14, 15, 16].includes(channel.type)) return `#${channel.name}`;
|
if ([0, 2, 5, 13, 15, 16].includes(channel.type)) return `#${channel.name}`;
|
||||||
// DMs
|
// DMs
|
||||||
if (channel.type === 1) return `@${(() => {
|
if (channel.type === 1) return `@${(() => {
|
||||||
const user = UserStore.getUser(channel.recipients[0]);
|
const user = UserStore.getUser(channel.recipients[0]);
|
||||||
|
|
20
utils.tsx
Normal file
20
utils.tsx
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Vencord, a Discord client mod
|
||||||
|
* Copyright (c) 2025 Vendicated and contributors
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { classNameFactory } from "@api/Styles";
|
||||||
|
import { findComponentByCodeLazy } from "@webpack";
|
||||||
|
import { Guild } from "discord-types/general";
|
||||||
|
|
||||||
|
export const ServerProfileComponent = findComponentByCodeLazy("{guildProfile:v,fetchGuildProfile:O,fetchStatus:I}");
|
||||||
|
export const cl = classNameFactory("vc-serverprofileforward-");
|
||||||
|
|
||||||
|
export const ArrowSvg = () => <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="var(--text-low-contrast)" d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z" className=""></path></svg>;
|
||||||
|
|
||||||
|
export const checkForIconExistence = (guild: Guild) => {
|
||||||
|
if (!guild) return false;
|
||||||
|
if (!guild.icon) return false;
|
||||||
|
return true;
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue