1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-26 09:16:24 +00:00

change icon on hover

This commit is contained in:
programminglaboratorys 2024-10-01 16:06:42 +03:00
parent 63298f7580
commit 3906b56140

View file

@ -56,8 +56,13 @@ const customStatusSettings = getUserSettingLazy("status", "customStatus");
const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={() => customStatusSettings?.updateSetting(null)}><Icons.CircleXIcon size="sm" /></Clickable>; const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={() => customStatusSettings?.updateSetting(null)}><Icons.CircleXIcon size="sm" /></Clickable>;
const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => { function StatusIcon({ isHovering, status }: { isHovering: boolean; status: DiscordStatus; }) {
return isHovering ?
<Icons.CircleXIcon size="sm" style={{ marginTop: "4px" }} />
: (status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />);
}
const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
const [isHovering, setIsHovering] = useState(false); const [isHovering, setIsHovering] = useState(false);
const handleMouseOver = () => { const handleMouseOver = () => {
setIsHovering(true); setIsHovering(true);
@ -82,8 +87,8 @@ const RenderStatusMenuItem = ({ status }: { status: DiscordStatus; }) => {
type: Toasts.Type.SUCCESS, type: Toasts.Type.SUCCESS,
id: Toasts.genId() id: Toasts.genId()
}); });
}}>{status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />}</Clickable> }}><StatusIcon isHovering={isHovering} status={status} /></Clickable>
<div className={StatusStyles.status} style={{ marginLeft: "5px" }}>{status.text}</div> <div className={StatusStyles.status} style={{ marginLeft: "2px" }}>{status.text}</div>
</div >; </div >;
}; };
@ -102,7 +107,7 @@ const StatusSubMenuComponent = () => {
export default definePlugin({ export default definePlugin({
name: "StatusPresets", name: "StatusPresets",
description: "Allows you to remember your status and set it later", description: "Allows you to remember your statuses and set them later",
authors: [Devs.Dolfies], authors: [Devs.Dolfies],
settings: settings, settings: settings,
dependencies: ["UserSettingsAPI"], dependencies: ["UserSettingsAPI"],