mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-25 18:13:48 -04:00
* Test * Add pretty formatting * Fix Tests * Fix Tests * Fix Tests * Fix * Add pretty formatting fix * Fix * Test * Fix tests * Clean typeckech * Add prettier check * Fix api tsconfig * Fix api tsconfig * Fix tsconfig * Fix * Fix * Prettier
25 lines
539 B
TypeScript
25 lines
539 B
TypeScript
import Link from 'next/link'
|
|
import {isNativeMobile} from 'web/lib/util/webview'
|
|
|
|
interface NewTabLinkProps {
|
|
href: string
|
|
children: React.ReactNode
|
|
className?: string
|
|
onClick?: () => void
|
|
}
|
|
|
|
export function NewTabLink({href, children, className, onClick}: NewTabLinkProps) {
|
|
// New tabs don't work on native apps
|
|
const isNative = isNativeMobile()
|
|
return (
|
|
<Link
|
|
href={href}
|
|
onClick={onClick}
|
|
target={isNative ? undefined : '_blank'}
|
|
className={className}
|
|
>
|
|
{children}
|
|
</Link>
|
|
)
|
|
}
|