fix: external links (#133)
* fix: footer external links * fix: ButtonLinkSecondary external links * fix: docs external links
This commit is contained in:
parent
4a464da994
commit
332e972397
|
@ -9,14 +9,21 @@ interface Props extends LinkProps {
|
||||||
|
|
||||||
export const ButtonLinkSecondary: React.FC<Props> = ({ href, children, ...restProps }) => {
|
export const ButtonLinkSecondary: React.FC<Props> = ({ href, children, ...restProps }) => {
|
||||||
const isExternal: boolean = href.toString().startsWith('http');
|
const isExternal: boolean = href.toString().startsWith('http');
|
||||||
|
|
||||||
const variant = LinkTheme.variants['button-link-secondary'];
|
const variant = LinkTheme.variants['button-link-secondary'];
|
||||||
return (
|
return (
|
||||||
<Stack sx={{ mt: '0 !important' }} {...variant}>
|
<Stack sx={{ mt: '0 !important' }} {...variant}>
|
||||||
<NextLink href={href} passHref {...restProps}>
|
{isExternal ? (
|
||||||
<Link variant='button-link-secondary' isExternal={isExternal}>
|
<Link variant='button-link-secondary' href={href.toString()} isExternal>
|
||||||
<Text textStyle='home-section-link-label'>{children}</Text>
|
<Text textStyle='home-section-link-label'>{children}</Text>
|
||||||
</Link>
|
</Link>
|
||||||
</NextLink>
|
) : (
|
||||||
|
<NextLink href={href.toString()} passHref {...restProps}>
|
||||||
|
<Link variant='button-link-secondary'>
|
||||||
|
<Text textStyle='home-section-link-label'>{children}</Text>
|
||||||
|
</Link>
|
||||||
|
</NextLink>
|
||||||
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,14 +28,15 @@ const MDComponents = {
|
||||||
},
|
},
|
||||||
// links
|
// links
|
||||||
a: ({ children, href }: any) => {
|
a: ({ children, href }: any) => {
|
||||||
return (
|
const isExternal = href.startsWith('http') && !href.includes('geth.ethereum.org');
|
||||||
|
|
||||||
|
return isExternal ? (
|
||||||
|
<Link href={href} isExternal variant='light'>
|
||||||
|
{children}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
<NextLink href={href} passHref>
|
<NextLink href={href} passHref>
|
||||||
<Link
|
<Link variant='light'>{children}</Link>
|
||||||
isExternal={href.startsWith('http') && !href.includes('geth.ethereum.org')}
|
|
||||||
variant='light'
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Link>
|
|
||||||
</NextLink>
|
</NextLink>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -82,11 +82,9 @@ export const Footer: FC = () => {
|
||||||
_hover={hoverStyles}
|
_hover={hoverStyles}
|
||||||
p={4}
|
p={4}
|
||||||
>
|
>
|
||||||
<NextLink href={GETH_TWITTER_URL} passHref>
|
<Link href={GETH_TWITTER_URL} isExternal>
|
||||||
<Link isExternal>
|
<TwitterIcon w={8} height='22px' _groupHover={{ color: 'bg' }} color='primary' />
|
||||||
<TwitterIcon w={8} height='22px' _groupHover={{ color: 'bg' }} color='primary' />
|
</Link>
|
||||||
</Link>
|
|
||||||
</NextLink>
|
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
<Center
|
<Center
|
||||||
|
@ -98,24 +96,15 @@ export const Footer: FC = () => {
|
||||||
borderColor='primary'
|
borderColor='primary'
|
||||||
p={4}
|
p={4}
|
||||||
>
|
>
|
||||||
<NextLink href={GETH_DISCORD_URL} passHref>
|
<Link href={GETH_DISCORD_URL} isExternal>
|
||||||
<Link isExternal>
|
<DiscordIcon w={8} height='22px' _groupHover={{ color: 'bg' }} color='primary' />
|
||||||
<DiscordIcon w={8} height='22px' _groupHover={{ color: 'bg' }} color='primary' />
|
</Link>
|
||||||
</Link>
|
|
||||||
</NextLink>
|
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
<Center
|
<Center data-group flex={1} _hover={hoverStyles} p={4}>
|
||||||
data-group
|
<Link href={GETH_REPO_URL} isExternal>
|
||||||
flex={1}
|
<GitHubIcon w={7} height='22px' _groupHover={{ color: 'bg' }} color='primary' />
|
||||||
_hover={hoverStyles}
|
</Link>
|
||||||
p={4}
|
|
||||||
>
|
|
||||||
<NextLink href={GETH_REPO_URL} passHref>
|
|
||||||
<Link isExternal>
|
|
||||||
<GitHubIcon w={7} height='22px' _groupHover={{ color: 'bg' }} color='primary' />
|
|
||||||
</Link>
|
|
||||||
</NextLink>
|
|
||||||
</Center>
|
</Center>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
Loading…
Reference in New Issue