Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove 3rd party notification from link to explorer, closes #937
- Loading branch information
1 parent
0086913
commit 57e3dab
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { FC } from 'react'; | ||
import { Box, Text, BoxProps, color } from '@stacks/ui'; | ||
import { openExternalLink } from '@utils/external-links'; | ||
|
||
interface InternalLinkProps extends BoxProps { | ||
href: string; | ||
} | ||
|
||
export const InternalLink: FC<InternalLinkProps> = ({ href, children, ...props }) => { | ||
const openUrl = () => openExternalLink(href); | ||
return ( | ||
<Text | ||
onClick={openUrl} | ||
as="button" | ||
type="button" | ||
cursor="pointer" | ||
display="block" | ||
outline={0} | ||
color={color('brand')} | ||
_hover={{ textDecoration: 'underline' }} | ||
_focus={{ textDecoration: 'underline' }} | ||
{...props} | ||
> | ||
{children} | ||
<Box display="inline-block" ml="extra-tight" mb="1px"> | ||
↗ | ||
</Box> | ||
</Text> | ||
); | ||
}; |