mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-11 23:53:03 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
# Conflicts: # eslint.config.mjs # package.json # pnpm-lock.yaml # src/components/PluginSettings/index.tsx # src/plugins/imageZoom/index.tsx # src/plugins/messageLogger/index.tsx # src/plugins/pictureInPicture/index.tsx # src/plugins/serverInfo/GuildInfoModal.tsx # src/plugins/whoReacted/index.tsx
This commit is contained in:
commit
f8879cc801
114 changed files with 2092 additions and 893 deletions
|
@ -8,8 +8,8 @@ import { ChatBarButton } from "@api/ChatButtons";
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin, { OptionType, StartAt } from "@utils/types";
|
||||
import { useMemo, useState } from "@webpack/common";
|
||||
import { MouseEventHandler } from "react";
|
||||
import { React, useMemo, useState } from "@webpack/common";
|
||||
import type { Fragment, MouseEventHandler, ReactNode } from "react";
|
||||
|
||||
let hidechatbuttonsopen: boolean | undefined;
|
||||
|
||||
|
@ -49,14 +49,9 @@ function HideToggleButton(props: { open: boolean | undefined, onClick: MouseEven
|
|||
</svg>
|
||||
</ChatBarButton>);
|
||||
}
|
||||
interface ButtonReactNode {
|
||||
props?: {
|
||||
disabled?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
function buttonsInner(buttons: ButtonReactNode[]) {
|
||||
if (buttons.every(x => x.props?.disabled === true)) {
|
||||
function buttonsInner(buttons: ReactNode[]) {
|
||||
if (buttons.every(x => (x as any)?.props?.disabled === true)) {
|
||||
return null;
|
||||
}
|
||||
const [open, setOpen] = useState(hidechatbuttonsopen);
|
||||
|
@ -66,17 +61,16 @@ function buttonsInner(buttons: ButtonReactNode[]) {
|
|||
}, [open]);
|
||||
|
||||
const buttonList = (
|
||||
<div id="chat-bar-buttons-menu" style={{
|
||||
<div key={"chat-bar-buttons-menu"} id="chat-bar-buttons-menu" style={{
|
||||
display: "flex",
|
||||
flexWrap: "nowrap",
|
||||
overflowX: "auto"
|
||||
}}>
|
||||
{open ? buttons.map(b => <>{b}</>) : null}
|
||||
{open ? buttons.map((b, i) => <React.Fragment key={i}>{b}</React.Fragment>) : null}
|
||||
<HideToggleButton onClick={() => setOpen(!open)} open={open}></HideToggleButton>
|
||||
</div>
|
||||
);
|
||||
buttons = [buttonList];
|
||||
return buttons;
|
||||
return [buttonList];
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue