fix buttons (#1308)

This commit is contained in:
Red J Adaya 2024-11-16 13:26:48 +08:00 committed by GitHub
parent f64863c52a
commit 55558d441e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 19 deletions

View File

@ -12,8 +12,6 @@ interface LinkButtonProps {
target?: string;
children: React.ReactNode;
disabled?: boolean;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
style?: React.CSSProperties;
autoFocus?: boolean;
className?: string;
@ -22,14 +20,10 @@ interface LinkButtonProps {
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
}
const LinkButton = ({ leftIcon, rightIcon, children, className, ...rest }: LinkButtonProps) => {
const LinkButton = ({ children, className, ...rest }: LinkButtonProps) => {
return (
<a {...rest} className={clsx("button grey solid link-button", className)}>
<span className="button-inner">
{leftIcon && <span className="icon-left">{leftIcon}</span>}
{children}
{rightIcon && <span className="icon-right">{rightIcon}</span>}
</span>
<span className="button-inner">{children}</span>
</a>
);
};

View File

@ -58,6 +58,7 @@
i {
font-size: 16px;
margin-right: 5px;
}
}
}

View File

@ -41,26 +41,19 @@ const AboutModal = ({}: AboutModalProps) => {
className="secondary solid"
href="https://github.com/wavetermdev/waveterm"
target="_blank"
leftIcon={<i className="fa-brands fa-github"></i>}
>
Github
<i className="fa-brands fa-github"></i>Github
</LinkButton>
<LinkButton
className="secondary solid"
href="https://www.waveterm.dev/"
target="_blank"
leftIcon={<i className="fa-sharp fa-light fa-globe"></i>}
>
Website
<LinkButton className="secondary solid" href="https://www.waveterm.dev/" target="_blank">
<i className="fa-sharp fa-light fa-globe"></i>Website
</LinkButton>
<LinkButton
className="secondary solid"
href="https://github.com/wavetermdev/waveterm/blob/main/ACKNOWLEDGEMENTS.md"
target="_blank"
rel={"noopener"}
leftIcon={<i className="fa-sharp fa-light fa-heart"></i>}
>
Acknowledgements
<i className="fa-sharp fa-light fa-heart"></i>Acknowledgements
</LinkButton>
</div>
<div className="section text-standard">&copy; {currentDate.getFullYear()} Command Line Inc.</div>