fix add endIconClassName in button (#3893)

* fix add tooltip provider to tooltip

* fix: add endIconClassNames support for button as startIcon has

* fix: undo tooltip provder

Co-authored-by: Agusti Fernandez Pardo <git@agusti.me>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/3939/head
Agusti Fernandez Pardo 2022-08-24 10:37:46 +02:00 committed by GitHub
parent 4e73c4f7fb
commit bfe780e0af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,7 @@ export type ButtonBaseProps = {
StartIcon?: SVGComponent; StartIcon?: SVGComponent;
startIconClassName?: string; startIconClassName?: string;
EndIcon?: SVGComponent; EndIcon?: SVGComponent;
endIconClassName?: string;
shallow?: boolean; shallow?: boolean;
}; };
export type ButtonProps = ButtonBaseProps & export type ButtonProps = ButtonBaseProps &
@ -32,6 +33,7 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
size = "base", size = "base",
StartIcon, StartIcon,
startIconClassName, startIconClassName,
endIconClassName,
EndIcon, EndIcon,
shallow, shallow,
// attributes propagated from `HTMLAnchorProps` or `HTMLButtonProps` // attributes propagated from `HTMLAnchorProps` or `HTMLButtonProps`
@ -130,7 +132,9 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
</svg> </svg>
</div> </div>
)} )}
{EndIcon && <EndIcon className="-mr-1 inline h-5 w-5 ltr:ml-2 rtl:mr-2" />} {EndIcon && (
<EndIcon className={classNames("-mr-1 inline h-5 w-5 ltr:ml-2 rtl:mr-2", endIconClassName || "")} />
)}
</> </>
); );
return props.href ? ( return props.href ? (