mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 16:06:12 +02:00
content(resources): add link to GitHub
This commit is contained in:
@@ -7,5 +7,15 @@ export function ResourcesLink({
|
|||||||
}: PropsWithChildren<{
|
}: PropsWithChildren<{
|
||||||
to: string
|
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>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Link } from "gatsby"
|
import { Link } from "gatsby"
|
||||||
import styled from "styled-components"
|
import styled, { css } from "styled-components"
|
||||||
|
|
||||||
export const ResourcesLinkWrapper = styled(Link)`
|
const linkStyle = css`
|
||||||
color: #0090d8;
|
color: #0090d8;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
border-bottom: 2px solid;
|
border-bottom: 2px solid;
|
||||||
@@ -14,3 +14,11 @@ export const ResourcesLinkWrapper = styled(Link)`
|
|||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
export const ResourcesLinkInternal = styled(Link)`
|
||||||
|
${linkStyle}
|
||||||
|
`
|
||||||
|
|
||||||
|
export const ResourcesLinkExternal = styled.a`
|
||||||
|
${linkStyle}
|
||||||
|
`
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import React, { Fragment } from "react"
|
import React, { Fragment } from "react"
|
||||||
|
|
||||||
|
import packageJson from "../../package.json"
|
||||||
import { ResourcesLink } from "../components/ResourcesLink"
|
import { ResourcesLink } from "../components/ResourcesLink"
|
||||||
import { ResourcesList } from "../components/ResourcesList"
|
import { ResourcesList } from "../components/ResourcesList"
|
||||||
import { SEO } from "../components/SEO"
|
import { SEO } from "../components/SEO"
|
||||||
@@ -14,6 +15,10 @@ function ResourcesPage() {
|
|||||||
on our Discord community,{" "}
|
on our Discord community,{" "}
|
||||||
<ResourcesLink to="/about">The Programmer's Hangout</ResourcesLink>.
|
<ResourcesLink to="/about">The Programmer's Hangout</ResourcesLink>.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
All of it is open source, and you can contribute to it on{" "}
|
||||||
|
<ResourcesLink to={packageJson.repository.url}>GitHub</ResourcesLink>.
|
||||||
|
</p>
|
||||||
<ResourcesList />
|
<ResourcesList />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-1
@@ -46,7 +46,7 @@
|
|||||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||||
// "types": [], /* Type declaration files to be included in compilation. */
|
// "types": [], /* Type declaration files to be included in compilation. */
|
||||||
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
|
|
||||||
@@ -59,5 +59,6 @@
|
|||||||
/* Experimental Options */
|
/* Experimental Options */
|
||||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||||
|
"resolveJsonModule": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -3,6 +3,7 @@ import "styled-components"
|
|||||||
|
|
||||||
declare module "*.svg"
|
declare module "*.svg"
|
||||||
declare module "*.png"
|
declare module "*.png"
|
||||||
|
declare module "*.json"
|
||||||
|
|
||||||
type ComponentQuery<T> = {
|
type ComponentQuery<T> = {
|
||||||
readonly data: T
|
readonly data: T
|
||||||
|
|||||||
Reference in New Issue
Block a user