mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 14:13:01 -04:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
commit
b013967b7b
20 changed files with 326 additions and 56 deletions
|
@ -13,10 +13,10 @@ import definePlugin, { OptionType } from "@utils/types";
|
|||
import { SelectedGuildStore, useState } from "@webpack/common";
|
||||
import { User } from "discord-types/general";
|
||||
|
||||
export const settings = definePluginSettings({
|
||||
hideAtSymbol: {
|
||||
const settings = definePluginSettings({
|
||||
showAtSymbol: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Whether the the @-symbol should be hidden.",
|
||||
description: "Whether the the @ symbol should be displayed",
|
||||
default: true
|
||||
}
|
||||
});
|
||||
|
@ -32,7 +32,9 @@ export default definePlugin({
|
|||
replace: "children:$self.renderUsername({username:$1,user:$2})"
|
||||
}
|
||||
}],
|
||||
|
||||
settings,
|
||||
|
||||
renderUsername: ErrorBoundary.wrap((props: { user: User, username: string; }) => {
|
||||
const { user, username } = props;
|
||||
const [isHovering, setIsHovering] = useState(false);
|
||||
|
@ -49,9 +51,11 @@ export default definePlugin({
|
|||
</span>
|
||||
);
|
||||
}, { noop: true })
|
||||
|
||||
});
|
||||
|
||||
function getUsernameString(username: string) {
|
||||
if (settings.store.hideAtSymbol) return username;
|
||||
return `@${username}`;
|
||||
return settings.store.showAtSymbol
|
||||
? `@${username}`
|
||||
: username;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue