mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
fix click issues
This commit is contained in:
parent
f1aba76502
commit
4fc7f6e453
2 changed files with 7 additions and 6 deletions
|
@ -54,15 +54,15 @@ const EmojiComponent = findComponentByCodeLazy(".translateSurrogatesToInlineEmoj
|
||||||
|
|
||||||
const customStatusSettings = getUserSettingLazy("status", "customStatus");
|
const customStatusSettings = getUserSettingLazy("status", "customStatus");
|
||||||
|
|
||||||
const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={() => customStatusSettings?.updateSetting(null)}><Icons.CircleXIcon size="sm" style={{ pointerEvents: "none" }} /></Clickable>;
|
const ClearStatusButton = () => <Clickable className={StatusStyles.clearCustomStatusHint} onClick={e => { e.stopPropagation(); customStatusSettings?.updateSetting(null); }}><Icons.CircleXIcon size="sm" /></Clickable>;
|
||||||
|
|
||||||
function StatusIcon({ isHovering, status }: { isHovering: boolean; status: DiscordStatus; }) {
|
function StatusIcon({ isHovering, status }: { isHovering: boolean; status: DiscordStatus; }) {
|
||||||
return <div className={StatusStyles.status}>{isHovering ?
|
return <div className={StatusStyles.status}>{isHovering ?
|
||||||
<Icons.CircleXIcon size="sm" style={{ pointerEvents: "none" }} />
|
<Icons.CircleXIcon size="sm" />
|
||||||
: (status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />)}</div>;
|
: (status.emojiInfo != null ? <EmojiComponent emoji={status.emojiInfo} animate={false} hideTooltip={false} /> : <div className={StatusStyles.customEmojiPlaceholder} />)}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus; forceRerender: ()=>void}) => {
|
const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus; forceRerender: () => void; }) => {
|
||||||
const [isHovering, setIsHovering] = useState(false);
|
const [isHovering, setIsHovering] = useState(false);
|
||||||
const handleMouseOver = () => {
|
const handleMouseOver = () => {
|
||||||
setIsHovering(true);
|
setIsHovering(true);
|
||||||
|
@ -80,7 +80,8 @@ const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus
|
||||||
onMouseOver={handleMouseOver}
|
onMouseOver={handleMouseOver}
|
||||||
onMouseOut={handleMouseOut}>
|
onMouseOut={handleMouseOut}>
|
||||||
<Clickable
|
<Clickable
|
||||||
onClick={() => {
|
onClick={e => {
|
||||||
|
e.stopPropagation();
|
||||||
delete settings.store.StatusPresets[status.text];
|
delete settings.store.StatusPresets[status.text];
|
||||||
forceRerender();
|
forceRerender();
|
||||||
Toasts.show({
|
Toasts.show({
|
||||||
|
@ -157,7 +158,7 @@ export default definePlugin({
|
||||||
look={Button.Looks.LINK}
|
look={Button.Looks.LINK}
|
||||||
color={Button.Colors.WHITE}
|
color={Button.Colors.WHITE}
|
||||||
size={Button.Sizes.MEDIUM}
|
size={Button.Sizes.MEDIUM}
|
||||||
onClick={() => {
|
onClick={e => {
|
||||||
settings.store.StatusPresets[statue.text] = statue;
|
settings.store.StatusPresets[statue.text] = statue;
|
||||||
Toasts.show({
|
Toasts.show({
|
||||||
message: "Successfully Saved Status",
|
message: "Successfully Saved Status",
|
||||||
|
|
2
src/webpack/common/types/components.d.ts
vendored
2
src/webpack/common/types/components.d.ts
vendored
|
@ -477,7 +477,7 @@ export type Clickable = ComponentType<PropsWithChildren<{
|
||||||
href?: string;
|
href?: string;
|
||||||
ignoreKeyPress?: boolean;
|
ignoreKeyPress?: boolean;
|
||||||
|
|
||||||
onClick?(): void;
|
onClick?(e: React.MouseEvent<any>): void;
|
||||||
onKeyPress?(): void;
|
onKeyPress?(): void;
|
||||||
}>>;
|
}>>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue