Update commercial use trial wording

This commit is contained in:
Gregory Schier
2025-11-09 07:07:18 -08:00
parent 554e632c19
commit 9eddf716e1
4 changed files with 77 additions and 48 deletions

View File

@@ -12,32 +12,37 @@ interface Props extends HTMLAttributes<HTMLAnchorElement> {
export function Link({ href, children, noUnderline, className, ...other }: Props) {
const isExternal = href.match(/^https?:\/\//);
className = classNames(className, 'relative');
className = classNames(
className,
'relative',
'inline-flex items-center hover:underline group',
!noUnderline && 'underline',
);
if (isExternal) {
const isYaakLink = href.startsWith('https://yaak.app');
let finalHref = href;
if (href.startsWith('https://yaak.app')) {
if (isYaakLink) {
const url = new URL(href);
url.searchParams.set('ref', appInfo.identifier);
finalHref = url.toString();
}
return (
// eslint-disable-next-line react/jsx-no-target-blank
<a
href={finalHref}
target="_blank"
rel="noopener noreferrer"
className={classNames(
className,
'pr-4 inline-flex items-center hover:underline group',
!noUnderline && 'underline',
)}
onClick={(e) => {
e.preventDefault();
}}
rel={isYaakLink ? undefined : 'noopener noreferrer'}
onClick={(e) => e.preventDefault()}
className={className}
{...other}
>
<span className="pr-0.5">{children}</span>
<Icon className="inline absolute right-0.5 top-[0.3em] opacity-70 group-hover:opacity-100" size="xs" icon="external_link" />
<span className="pr-5">{children}</span>
<Icon
className="inline absolute right-0.5 top-[0.3em] opacity-70 group-hover:opacity-100"
size="xs"
icon="external_link"
/>
</a>
);
}