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:
parent
870b86a218
commit
457116ee52
2 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -40,6 +40,7 @@ function Contact({ isOpen, onCancel }: Props) {
|
|||
<Button
|
||||
type="outline"
|
||||
title={label}
|
||||
to={link}
|
||||
className={styles.button}
|
||||
onClick={() => window.open(link)}
|
||||
/>
|
||||
|
|
Loading…
Add table
Reference in a new issue