content(resources): add link to GitHub

This commit is contained in:
Jean-Philippe Sirois
2019-09-17 01:58:45 -04:00
parent 94f8c5317d
commit 568977a4ee
5 changed files with 29 additions and 4 deletions
+11 -1
View File
@@ -7,5 +7,15 @@ export function ResourcesLink({
}: PropsWithChildren<{
to: string
}>) {
return <SC.ResourcesLinkWrapper to={to}>{children}</SC.ResourcesLinkWrapper>
if (!to.match(/^(https?:\/\/)/)) {
return (
<SC.ResourcesLinkInternal to={to}>{children}</SC.ResourcesLinkInternal>
)
}
return (
<SC.ResourcesLinkExternal href={to} target="_blank">
{children}
</SC.ResourcesLinkExternal>
)
}