mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +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 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; }) {
|
||||
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>;
|
||||
}
|
||||
|
||||
const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus; forceRerender: ()=>void}) => {
|
||||
const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus; forceRerender: () => void; }) => {
|
||||
const [isHovering, setIsHovering] = useState(false);
|
||||
const handleMouseOver = () => {
|
||||
setIsHovering(true);
|
||||
|
@ -80,7 +80,8 @@ const RenderStatusMenuItem = ({ status, forceRerender }: { status: DiscordStatus
|
|||
onMouseOver={handleMouseOver}
|
||||
onMouseOut={handleMouseOut}>
|
||||
<Clickable
|
||||
onClick={() => {
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
delete settings.store.StatusPresets[status.text];
|
||||
forceRerender();
|
||||
Toasts.show({
|
||||
|
@ -157,7 +158,7 @@ export default definePlugin({
|
|||
look={Button.Looks.LINK}
|
||||
color={Button.Colors.WHITE}
|
||||
size={Button.Sizes.MEDIUM}
|
||||
onClick={() => {
|
||||
onClick={e => {
|
||||
settings.store.StatusPresets[statue.text] = statue;
|
||||
Toasts.show({
|
||||
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;
|
||||
ignoreKeyPress?: boolean;
|
||||
|
||||
onClick?(): void;
|
||||
onClick?(e: React.MouseEvent<any>): void;
|
||||
onKeyPress?(): void;
|
||||
}>>;
|
||||
|
||||
|
|
Loading…
Reference in a new issue