Fixes For Merge

This commit is contained in:
thororen1234 2025-05-21 16:07:38 -04:00
parent a522db9e40
commit f0229d6185
No known key found for this signature in database
3 changed files with 12 additions and 2 deletions

View file

@ -7,6 +7,8 @@
import { Text, Tooltip } from "@webpack/common";
import type { ComponentProps } from "react";
import { buttonRef } from "./BuilderColorButton";
export interface BuilderButtonProps {
label?: string | undefined;
tooltip?: string | undefined;
@ -32,6 +34,7 @@ export const BuilderButton = ({ label, tooltip, selectedStyle, buttonProps }: Bu
borderRadius: "4px",
cursor: "pointer"
}}
ref={buttonRef}
>
{!selectedStyle && (
<svg

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Popout } from "@webpack/common";
import { Popout, useRef } from "@webpack/common";
import { BuilderButton, type BuilderButtonProps, CustomColorPicker, type CustomColorPickerProps } from ".";
@ -13,9 +13,12 @@ export interface BuilderColorButtonProps extends Pick<BuilderButtonProps, "label
setColor: (color: number | null) => void;
}
export const buttonRef = useRef(null);
export const BuilderColorButton = ({ label, color, setColor, suggestedColors }: BuilderColorButtonProps) => (
<Popout
position="bottom"
targetElementRef={buttonRef}
renderPopout={() => (
<CustomColorPicker
value={color}

View file

@ -6,7 +6,7 @@
import { classes } from "@utils/misc";
import { findByCode } from "@webpack";
import { Button, Clickable, Menu, Popout, React } from "@webpack/common";
import { Button, Clickable, Menu, Popout, React, useRef } from "@webpack/common";
import { SvgOverFlowIcon } from "../icons/overFlowIcon";
@ -101,6 +101,8 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
);
}, [tabs, selectedTabId, onSelectTab, overflowedTabs]);
const buttonRef = useRef(null);
return (
<div
className={classes("vc-notebook-tabbar")}
@ -137,9 +139,11 @@ export function NoteBookTabs({ tabs, selectedTabId, onSelectTab }: { tabs: strin
position="bottom"
align="right"
spacing={0}
targetElementRef={buttonRef}
>
{props => (
<Button
ref={buttonRef}
{...props}
className={"vc-notebook-overflow-chevron"}
size={Button.Sizes.ICON}