change prop name from side to tooltipSide for Button element

pullrequests/Siddharth-2382/sid/event-type-single
Siddharth Movaliya 2023-10-12 15:52:28 +05:30
parent 5fbab54bfd
commit 7f285cbd48
2 changed files with 8 additions and 8 deletions

View File

@ -309,7 +309,7 @@ function EventTypeSingleLayout({
variant="icon"
StartIcon={LinkIcon}
tooltip={t("copy_link")}
side="bottom"
tooltipSide="bottom"
onClick={() => {
navigator.clipboard.writeText(permalink);
showToast("Link copied!", "success");
@ -321,7 +321,7 @@ function EventTypeSingleLayout({
color="secondary"
variant="icon"
tooltip={t("embed")}
side="bottom"
tooltipSide="bottom"
eventId={eventType.id}
/>
</>
@ -332,7 +332,7 @@ function EventTypeSingleLayout({
variant="icon"
StartIcon={Trash}
tooltip={t("delete")}
side="bottom"
tooltipSide="bottom"
disabled={!hasPermsToDelete}
onClick={() => setDeleteDialogOpen(true)}
/>

View File

@ -23,7 +23,7 @@ export type ButtonBaseProps = {
shallow?: boolean;
/**Tool tip used when icon size is set to small */
tooltip?: string;
side?: "top" | "right" | "bottom" | "left";
tooltipSide?: "top" | "right" | "bottom" | "left";
disabled?: boolean;
flex?: boolean;
} & Omit<InferredVariantProps, "color"> & {
@ -215,7 +215,7 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
{element}
</Link>
) : (
<Wrapper data-testid="wrapper" tooltip={props.tooltip} side={props.side}>
<Wrapper data-testid="wrapper" tooltip={props.tooltip} tooltipSide={props.tooltipSide}>
{element}
</Wrapper>
);
@ -224,18 +224,18 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
const Wrapper = ({
children,
tooltip,
side,
tooltipSide,
}: {
tooltip?: string;
children: React.ReactNode;
side?: "top" | "right" | "bottom" | "left";
tooltipSide?: "top" | "right" | "bottom" | "left";
}) => {
if (!tooltip) {
return <>{children}</>;
}
return (
<Tooltip data-testid="tooltip" content={tooltip} side={side}>
<Tooltip data-testid="tooltip" content={tooltip} side={tooltipSide}>
{children}
</Tooltip>
);