({href, ...props}: LinkButtonProps)
| 35 | } |
| 36 | |
| 37 | export function LinkButton({href, ...props}: LinkButtonProps) { |
| 38 | if (href?.startsWith('s2:') || href?.startsWith('react-aria:')) { |
| 39 | let url = new URL(href); |
| 40 | href = getBaseUrl(url.protocol.slice(0, -1) as any) + '/' + url.pathname; |
| 41 | } |
| 42 | |
| 43 | return ( |
| 44 | <S2LinkButton {...props} ref={registerSpectrumLink} href={href} {...getAnchorProps(href)} /> |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | const baseUrl = getBaseUrl((process.env.LIBRARY as any) || 'react-aria'); |
| 49 | export function getAnchorProps(href) { |
nothing calls this directly
no test coverage detected