fix external links softlocking the ui in testing store cta

This commit is contained in:
AAGaming
2024-09-01 20:40:12 -04:00
parent a6e4bcf052
commit d06494885a
3 changed files with 24 additions and 6 deletions
+16
View File
@@ -0,0 +1,16 @@
import { Navigation } from '@decky/ui';
import { AnchorHTMLAttributes, FC } from 'react';
const ExternalLink: FC<AnchorHTMLAttributes<HTMLAnchorElement>> = (props) => {
return (
<a
{...props}
onClick={(e) => {
e.preventDefault();
props.onClick ? props.onClick(e) : props.href && Navigation.NavigateToExternalWeb(props.href);
}}
/>
);
};
export default ExternalLink;