Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Commit

Permalink
Move helper function into file where its now being used
Browse files Browse the repository at this point in the history
  • Loading branch information
lesliecdubs committed Feb 8, 2020
1 parent ab9be32 commit fe62d8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
12 changes: 0 additions & 12 deletions gatsby-node.js
Expand Up @@ -31,18 +31,6 @@ function extractRelevantProjectData(data, configDays) {
})
}

exports.getStarterTemplateRepoUrl = (repo, repoHost = 'github') => {
if (!repo) {
return
}
switch (repoHost) {
case 'github':
return `https://github.com/${repo}`
case 'gitlab':
return `https://gitlab.com/${repo}`
}
}

exports.sourceNodes = async ({
graphql,
actions,
Expand Down
13 changes: 12 additions & 1 deletion src/components/projectcard.js
Expand Up @@ -6,7 +6,6 @@ import { EntypoTwitter } from 'react-entypo'
import Stat from './stat'
import DeployButton from './deploybutton'
import DataPoint from './datapoint'
import { getStarterTemplateRepoUrl } from "../../gatsby-node.js";

const TwitterIcon = styled(EntypoTwitter)`
width: 16px !important;
Expand Down Expand Up @@ -46,6 +45,18 @@ const CardBodyLink = styled(Link)`
}
`

function getStarterTemplateRepoUrl(repo, repoHost = 'github') {
if (!repo) {
return
}
switch (repoHost) {
case 'github':
return `https://github.com/${repo}`
case 'gitlab':
return `https://gitlab.com/${repo}`
}
}

const Title = styled.h4`
margin: 0 -18px 0px;
font-weight: normal;
Expand Down

0 comments on commit fe62d8b

Please sign in to comment.