Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d10b3e5

Browse files
authored
feat(www): Adds CodeSandbox in Try this starter (gatsbyjs#20948)
* Add CodeSandbox logo * Adding CodeSandbox 'Try this starter' option * Adding CodeSandbox 'Try this starter' option * Fix icons and add whitespace between options * Add whitespace with space[]
1 parent 3387b2b commit d10b3e5

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed
Lines changed: 4 additions & 0 deletions
Loading

www/src/templates/template-starter-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class StarterTemplate extends React.Component {
111111
alt={`Screenshot of ${repoName}`}
112112
/>
113113
</div>
114-
<StarterSource repoUrl={repoUrl} startersYaml={startersYaml} />
114+
<StarterSource repoUrl={repoUrl} startersYaml={startersYaml} starter={starterShowcase} />
115115
<StarterInstallation repoName={repoName} repoUrl={repoUrl} />
116116
<StarterDetails
117117
startersYaml={startersYaml}

www/src/views/starter/source.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { jsx } from "theme-ui"
33
import { mediaQueries } from "../../gatsby-plugin-theme-ui"
44
import TechWithIcon from "../../components/tech-with-icon"
55
import GithubIcon from "react-icons/lib/fa/github"
6-
import { NetlifyIcon } from "../../assets/vendor-logos/netlify.svg"
6+
import CodesandboxIcon from "../../assets/vendor-logos/codesandbox.svg"
7+
import NetlifyIcon from "../../assets/vendor-logos/netlify.svg"
78

8-
const Source = ({ startersYaml, repoUrl }) => (
9+
const Source = ({ startersYaml, repoUrl, starter }) => (
910
<div
1011
sx={{
1112
display: `flex`,
@@ -66,6 +67,17 @@ const Source = ({ startersYaml, repoUrl }) => (
6667
>
6768
Try this starter
6869
</span>
70+
<a
71+
href={`https://codesandbox.io/s/github/${starter.owner}/${starter.stub}`}
72+
sx={{
73+
"&&": {
74+
borderBottom: 0,
75+
marginRight: t => t.space[4]
76+
},
77+
}}
78+
>
79+
<TechWithIcon icon={CodesandboxIcon}>CodeSandbox</TechWithIcon>
80+
</a> &nbsp;
6981
<a
7082
href={`https://app.netlify.com/start/deploy?repository=${repoUrl}`}
7183
sx={{

0 commit comments

Comments
 (0)