mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-10 12:10:24 -04:00
feat(showbadgesinchat): move some stuff
This commit is contained in:
parent
e3fdc8b22a
commit
80f0e49bb7
2 changed files with 22 additions and 22 deletions
|
@ -33,10 +33,10 @@ const discordBadges: readonly [number, string, string][] = Object.freeze([
|
||||||
|
|
||||||
function CheckBadge({ badge, author }: { badge: string; author: any; }): JSX.Element | null {
|
function CheckBadge({ badge, author }: { badge: string; author: any; }): JSX.Element | null {
|
||||||
switch (badge) {
|
switch (badge) {
|
||||||
case "VencordDonor":
|
case "EquicordDonor":
|
||||||
return (
|
return (
|
||||||
<span style={{ order: settings.store.VencordDonorPosition }}>
|
<span style={{ order: settings.store.VencordDonorPosition }}>
|
||||||
{badges.getDonorBadges(author.id)?.map((badge: any) => (
|
{badges.getEquicordDonorBadges(author.id)?.map((badge: any) => (
|
||||||
<RoleIconComponent
|
<RoleIconComponent
|
||||||
className={roleIconClassName}
|
className={roleIconClassName}
|
||||||
name={badge.description}
|
name={badge.description}
|
||||||
|
@ -46,10 +46,10 @@ function CheckBadge({ badge, author }: { badge: string; author: any; }): JSX.Ele
|
||||||
))}
|
))}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
case "EquicordDonor":
|
case "VencordDonor":
|
||||||
return (
|
return (
|
||||||
<span style={{ order: settings.store.VencordDonorPosition }}>
|
<span style={{ order: settings.store.VencordDonorPosition }}>
|
||||||
{badges.getEquicordDonorBadges(author.id)?.map((badge: any) => (
|
{badges.getDonorBadges(author.id)?.map((badge: any) => (
|
||||||
<RoleIconComponent
|
<RoleIconComponent
|
||||||
className={roleIconClassName}
|
className={roleIconClassName}
|
||||||
name={badge.description}
|
name={badge.description}
|
||||||
|
@ -108,8 +108,8 @@ function CheckBadge({ badge, author }: { badge: string; author: any; }): JSX.Ele
|
||||||
function ChatBadges({ author }: any) {
|
function ChatBadges({ author }: any) {
|
||||||
return (
|
return (
|
||||||
<span style={{ display: "inline-flex", marginLeft: 2, verticalAlign: "top" }}>
|
<span style={{ display: "inline-flex", marginLeft: 2, verticalAlign: "top" }}>
|
||||||
{settings.store.showVencordDonor && <CheckBadge badge={"VencordDonor"} author={author} />}
|
|
||||||
{settings.store.showVencordDonor && <CheckBadge badge={"EquicordDonor"} author={author} />}
|
{settings.store.showVencordDonor && <CheckBadge badge={"EquicordDonor"} author={author} />}
|
||||||
|
{settings.store.showVencordDonor && <CheckBadge badge={"VencordDonor"} author={author} />}
|
||||||
{settings.store.showVencordContributor && <CheckBadge badge={"VencordContributer"} author={author} />}
|
{settings.store.showVencordContributor && <CheckBadge badge={"VencordContributer"} author={author} />}
|
||||||
{settings.store.showDiscordProfile && <CheckBadge badge={"DiscordProfile"} author={author} />}
|
{settings.store.showDiscordProfile && <CheckBadge badge={"DiscordProfile"} author={author} />}
|
||||||
{settings.store.showDiscordNitro && <CheckBadge badge={"DiscordNitro"} author={author} />}
|
{settings.store.showDiscordNitro && <CheckBadge badge={"DiscordNitro"} author={author} />}
|
||||||
|
|
|
@ -11,18 +11,6 @@ import { OptionType } from "@utils/types";
|
||||||
import { Text, useEffect, UserStore, useState } from "@webpack/common";
|
import { Text, useEffect, UserStore, useState } from "@webpack/common";
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
const settings = definePluginSettings({
|
||||||
showVencordDonor: {
|
|
||||||
type: OptionType.BOOLEAN,
|
|
||||||
description: "Enable to show Vencord donor badges in chat.",
|
|
||||||
hidden: true,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
VencordDonorPosition: {
|
|
||||||
type: OptionType.NUMBER,
|
|
||||||
description: "The position of the Vencord Donor badges.",
|
|
||||||
hidden: true,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
showEquicordDonor: {
|
showEquicordDonor: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "Enable to show Vencord donor badges in chat.",
|
description: "Enable to show Vencord donor badges in chat.",
|
||||||
|
@ -35,6 +23,18 @@ const settings = definePluginSettings({
|
||||||
hidden: true,
|
hidden: true,
|
||||||
default: 1
|
default: 1
|
||||||
},
|
},
|
||||||
|
showVencordDonor: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Enable to show Vencord donor badges in chat.",
|
||||||
|
hidden: true,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
VencordDonorPosition: {
|
||||||
|
type: OptionType.NUMBER,
|
||||||
|
description: "The position of the Vencord Donor badges.",
|
||||||
|
hidden: true,
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
showVencordContributor: {
|
showVencordContributor: {
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
description: "Enable to show Vencord contributor badges in chat.",
|
description: "Enable to show Vencord contributor badges in chat.",
|
||||||
|
@ -82,8 +82,8 @@ export default settings;
|
||||||
|
|
||||||
const BadgeSettings = () => {
|
const BadgeSettings = () => {
|
||||||
const [images, setImages] = useState([
|
const [images, setImages] = useState([
|
||||||
{ src: "https://cdn.discordapp.com/emojis/1026533070955872337.png", shown: settings.store.showVencordDonor, title: "Vencord donor badges", key: "VencordDonor", position: settings.store.VencordDonorPosition },
|
|
||||||
{ src: "https://i.imgur.com/KsxHlbD.png", shown: settings.store.showEquicordDonor, title: "Equicord donor badges", key: "EquicordDonor", position: settings.store.EquicordDonorPosition },
|
{ src: "https://i.imgur.com/KsxHlbD.png", shown: settings.store.showEquicordDonor, title: "Equicord donor badges", key: "EquicordDonor", position: settings.store.EquicordDonorPosition },
|
||||||
|
{ src: "https://cdn.discordapp.com/emojis/1026533070955872337.png", shown: settings.store.showVencordDonor, title: "Vencord donor badges", key: "VencordDonor", position: settings.store.VencordDonorPosition },
|
||||||
{ src: "https://i.imgur.com/OypoHrV.png", shown: settings.store.showVencordContributor, title: "Vencord/Equicord contributor badge", key: "VencordContributer", position: settings.store.VencordContributorPosition },
|
{ src: "https://i.imgur.com/OypoHrV.png", shown: settings.store.showVencordContributor, title: "Vencord/Equicord contributor badge", key: "VencordContributer", position: settings.store.VencordContributorPosition },
|
||||||
{ src: "https://cdn.discordapp.com/badge-icons/bf01d1073931f921909045f3a39fd264.png", shown: settings.store.showDiscordProfile, title: "Discord profile badges (HypeSquad, Discord Staff, Active Developer, etc.)", key: "DiscordProfile", position: settings.store.DiscordProfilePosition },
|
{ src: "https://cdn.discordapp.com/badge-icons/bf01d1073931f921909045f3a39fd264.png", shown: settings.store.showDiscordProfile, title: "Discord profile badges (HypeSquad, Discord Staff, Active Developer, etc.)", key: "DiscordProfile", position: settings.store.DiscordProfilePosition },
|
||||||
{ src: "https://cdn.discordapp.com/badge-icons/2ba85e8026a8614b640c2837bcdfe21b.png", shown: settings.store.showDiscordNitro, title: "Nitro badge", key: "DiscordNitro", position: settings.store.DiscordNitroPosition }
|
{ src: "https://cdn.discordapp.com/badge-icons/2ba85e8026a8614b640c2837bcdfe21b.png", shown: settings.store.showDiscordNitro, title: "Nitro badge", key: "DiscordNitro", position: settings.store.DiscordNitroPosition }
|
||||||
|
@ -92,14 +92,14 @@ const BadgeSettings = () => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
images.forEach(image => {
|
images.forEach(image => {
|
||||||
switch (image.key) {
|
switch (image.key) {
|
||||||
case "VencordDonor":
|
|
||||||
settings.store.VencordDonorPosition = image.position;
|
|
||||||
settings.store.showVencordDonor = image.shown;
|
|
||||||
break;
|
|
||||||
case "EquiordDonor":
|
case "EquiordDonor":
|
||||||
settings.store.EquicordDonorPosition = image.position;
|
settings.store.EquicordDonorPosition = image.position;
|
||||||
settings.store.showEquicordDonor = image.shown;
|
settings.store.showEquicordDonor = image.shown;
|
||||||
break;
|
break;
|
||||||
|
case "VencordDonor":
|
||||||
|
settings.store.VencordDonorPosition = image.position;
|
||||||
|
settings.store.showVencordDonor = image.shown;
|
||||||
|
break;
|
||||||
case "VencordContributer":
|
case "VencordContributer":
|
||||||
settings.store.VencordContributorPosition = image.position;
|
settings.store.VencordContributorPosition = image.position;
|
||||||
settings.store.showVencordContributor = image.shown;
|
settings.store.showVencordContributor = image.shown;
|
||||||
|
|
Loading…
Add table
Reference in a new issue