Skip to content

Commit

Permalink
feat(www): Adds CodeSandbox in Try this starter (#20948)
Browse files Browse the repository at this point in the history
* 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[]
  • Loading branch information
garethx authored Feb 1, 2020
1 parent 3387b2b commit d10b3e5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions www/src/assets/vendor-logos/codesandbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion www/src/templates/template-starter-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class StarterTemplate extends React.Component {
alt={`Screenshot of ${repoName}`}
/>
</div>
<StarterSource repoUrl={repoUrl} startersYaml={startersYaml} />
<StarterSource repoUrl={repoUrl} startersYaml={startersYaml} starter={starterShowcase} />
<StarterInstallation repoName={repoName} repoUrl={repoUrl} />
<StarterDetails
startersYaml={startersYaml}
Expand Down
16 changes: 14 additions & 2 deletions www/src/views/starter/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { jsx } from "theme-ui"
import { mediaQueries } from "../../gatsby-plugin-theme-ui"
import TechWithIcon from "../../components/tech-with-icon"
import GithubIcon from "react-icons/lib/fa/github"
import { NetlifyIcon } from "../../assets/vendor-logos/netlify.svg"
import CodesandboxIcon from "../../assets/vendor-logos/codesandbox.svg"
import NetlifyIcon from "../../assets/vendor-logos/netlify.svg"

const Source = ({ startersYaml, repoUrl }) => (
const Source = ({ startersYaml, repoUrl, starter }) => (
<div
sx={{
display: `flex`,
Expand Down Expand Up @@ -66,6 +67,17 @@ const Source = ({ startersYaml, repoUrl }) => (
>
Try this starter
</span>
<a
href={`https://codesandbox.io/s/github/${starter.owner}/${starter.stub}`}
sx={{
"&&": {
borderBottom: 0,
marginRight: t => t.space[4]
},
}}
>
<TechWithIcon icon={CodesandboxIcon}>CodeSandbox</TechWithIcon>
</a> &nbsp;
<a
href={`https://app.netlify.com/start/deploy?repository=${repoUrl}`}
sx={{
Expand Down

0 comments on commit d10b3e5

Please sign in to comment.