0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-17 22:04:19 -05:00

chore(console): add href to Button component (#3619)

This commit is contained in:
Darcy Ye 2023-03-30 15:28:28 +08:00 committed by GitHub
parent 870b86a218
commit 457116ee52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -26,6 +26,7 @@ type BaseProps = Omit<HTMLProps<HTMLButtonElement>, 'type' | 'size' | 'title'> &
isLoading?: boolean;
loadingDelay?: number;
trailingIcon?: ReactNode;
to?: string;
};
type TitleButtonProps = BaseProps & {
@ -51,6 +52,7 @@ function Button({
loadingDelay = 500,
onClick,
trailingIcon,
to,
...rest
}: Props) {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
@ -83,6 +85,7 @@ function Button({
className
)}
type={htmlType}
title={to}
onClick={(event) => {
if (isLoading) {
return false;

View file

@ -40,6 +40,7 @@ function Contact({ isOpen, onCancel }: Props) {
<Button
type="outline"
title={label}
to={link}
className={styles.button}
onClick={() => window.open(link)}
/>