fix toolbox

This commit is contained in:
Vendicated 2026-03-13 14:20:14 +01:00
parent 06afe5fb21
commit 5861dd7fa4
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -28,7 +28,7 @@ import type { PropsWithChildren } from "react";
import { renderPopout } from "./menu";
const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '"aria-haspopup":');
const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_BOTTOM,", 'position:"bottom"');
export const settings = definePluginSettings({
showPluginMenu: {
@ -40,7 +40,7 @@ export const settings = definePluginSettings({
function Icon({ isShown }: { isShown: boolean; }) {
return (
<svg viewBox="0 0 27 27" width={24} height={24} className="vc-toolbox-icon">
<svg viewBox="0 0 27 27" width={18} height={18} className="vc-toolbox-icon">
{isShown
? <path fill="currentColor" d="M9 0h1v1h1v2h1v2h3V3h1V1h1V0h1v2h1v2h1v7h-1v-1h-3V9h1V6h-1v4h-3v1h1v-1h2v1h3v1h-1v1h-3v2h1v1h1v1h1v3h-1v4h-2v-1h-1v-4h-1v4h-1v1h-2v-4H9v-3h1v-1h1v-1h1v-2H9v-1H8v-1h3V6h-1v3h1v1H8v1H7V4h1V2h1M5 19h2v1h1v1h1v3H4v-1h2v-1H4v-2h1m15-1h2v1h1v2h-2v1h2v1h-5v-3h1v-1h1m4 3h4v1h-4" />
: <path fill="currentColor" d="M0 0h7v1H6v1H5v1H4v1H3v1H2v1h5v1H0V6h1V5h1V4h1V3h1V2h1V1H0m13 2h5v1h-1v1h-1v1h-1v1h3v1h-5V7h1V6h1V5h1V4h-3m8 5h1v5h1v-1h1v1h-1v1h1v-1h1v1h-1v3h-1v1h-2v1h-1v1h1v-1h2v-1h1v2h-1v1h-2v1h-1v-1h-1v1h-6v-1h-1v-1h-1v-2h1v1h2v1h3v1h1v-1h-1v-1h-3v-1h-4v-4h1v-2h1v-1h1v-1h1v2h1v1h1v-1h1v1h-1v1h2v-2h1v-2h1v-1h1M8 14h2v1H9v4h1v2h1v1h1v1h1v1h4v1h-6v-1H5v-1H4v-5h1v-1h1v-2h2m17 3h1v3h-1v1h-1v1h-1v2h-2v-2h2v-1h1v-1h1m1 0h1v3h-1v1h-2v-1h1v-1h1" />
@ -49,7 +49,7 @@ function Icon({ isShown }: { isShown: boolean; }) {
);
}
function VencordPopoutButton({ buttonClass }: { buttonClass: string; }) {
function VencordPopoutButton() {
const buttonRef = useRef(null);
const [show, setShow] = useState(false);
@ -66,7 +66,7 @@ function VencordPopoutButton({ buttonClass }: { buttonClass: string; }) {
{(_, { isShown }) => (
<HeaderBarIcon
ref={buttonRef}
className={`vc-toolbox-btn ${buttonClass}`}
className="vc-toolbox-btn"
onClick={() => setShow(v => !v)}
tooltip={isShown ? null : "Vencord Toolbox"}
icon={() => <Icon isShown={isShown} />}
@ -88,18 +88,18 @@ export default definePlugin({
{
find: '?"BACK_FORWARD_NAVIGATION":',
replacement: {
match: /(?<=trailing:.{0,50})\i\.Fragment,\{(?=.+?className:(\i\.\i))/,
replace: "$self.TrailingWrapper,{className:$1,"
match: /(?<=trailing:.{0,50})\i\.Fragment,(?=\{children:\[)/,
replace: "$self.TrailingWrapper,"
}
}
],
TrailingWrapper({ children, className }: PropsWithChildren<{ className: string; }>) {
TrailingWrapper({ children }: PropsWithChildren) {
return (
<>
{children}
<ErrorBoundary noop>
<VencordPopoutButton buttonClass={className} />
<ErrorBoundary key="vc-toolbox" noop>
<VencordPopoutButton />
</ErrorBoundary>
</>
);