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

View File

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