mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-27 07:24:55 -04:00
Some Fixes
This commit is contained in:
parent
8222eb430e
commit
d9a61fd436
9 changed files with 73 additions and 32 deletions
|
@ -28,7 +28,7 @@ import { ModalProps, openModalLazy } from "@utils/modal";
|
|||
import { useForceUpdater } from "@utils/react";
|
||||
import definePlugin, { OptionType, StartAt } from "@utils/types";
|
||||
import { extractAndLoadChunksLazy, findByPropsLazy, findComponentByCodeLazy, findModuleId, wreq } from "@webpack";
|
||||
import { Button, Clickable, Icons, Menu, Toasts, UserStore, useState } from "@webpack/common";
|
||||
import { Button, Clickable, Menu, Toasts, UserStore, useState } from "@webpack/common";
|
||||
import { FunctionComponent } from "react";
|
||||
|
||||
|
||||
|
@ -46,7 +46,20 @@ interface Emoji {
|
|||
id: bigint | null;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const CircleXIcon = <svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16" height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<line x1="15" y1="9" x2="9" y2="15" />
|
||||
<line x1="9" y1="9" x2="15" y2="15" />
|
||||
</svg>;
|
||||
interface DiscordStatus {
|
||||
emojiInfo: Emoji | null;
|
||||
text: string;
|
||||
|
@ -56,7 +69,6 @@ interface DiscordStatus {
|
|||
|
||||
const StatusStyles = findByPropsLazy("statusItem");
|
||||
// TODO: find clearCustomStatusHint original css/svg or replace
|
||||
|
||||
const PMenu = findComponentByCodeLazy(".menuItemLabel", ".menuItemInner");
|
||||
const EmojiComponent = findComponentByCodeLazy(/\.translateSurrogatesToInlineEmoji\(\i.\i\),/);
|
||||
|
||||
|
@ -90,11 +102,11 @@ function setStatus(status: DiscordStatus) {
|
|||
});
|
||||
}
|
||||
|
||||
const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={e => { e.stopPropagation(); CustomStatusSettings?.updateSetting(null); }}><Icons.CircleXIcon size="sm" /></Clickable>;
|
||||
const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={e => { e.stopPropagation(); CustomStatusSettings?.updateSetting(null); }}>{CircleXIcon}</Clickable>;
|
||||
|
||||
function StatusIcon({ isHovering, status }: { isHovering: boolean; status: DiscordStatus; }) {
|
||||
return <div className={StatusStyles.status}>{isHovering ?
|
||||
<Icons.CircleXIcon size="sm" />
|
||||
CircleXIcon
|
||||
: (status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />)}</div>;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue