-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(www): add code snippet with install command to starters (#16972)
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from "react" | ||
import Copy from "../../components/copy" | ||
import { | ||
colors, | ||
space, | ||
radii, | ||
mediaQueries, | ||
fontSizes, | ||
} from "../../utils/presets" | ||
|
||
const StarterInstallation = ({ repoName, repoUrl }) => { | ||
const content = `gatsby new ${repoName || `my-gatsby-project`} ${repoUrl}` | ||
return ( | ||
<div | ||
css={{ | ||
padding: `0px ${space[6]}`, | ||
[mediaQueries.lg]: { | ||
padding: `0px ${space[8]}`, | ||
display: `grid`, | ||
gridTemplateRows: `auto auto`, | ||
gridRowGap: space[2], | ||
}, | ||
}} | ||
> | ||
<div css={{ fontSize: fontSizes[1], color: colors.text.secondary }}> | ||
Install this starter locally: | ||
</div> | ||
<pre | ||
css={{ | ||
padding: 0, | ||
background: colors.code.bg, | ||
}} | ||
> | ||
<code | ||
css={{ | ||
display: `flex`, | ||
alignItems: `center`, | ||
justifyContent: `space-between`, | ||
padding: space[2], | ||
overflowWrap: `break-word`, | ||
[mediaQueries.lg]: { | ||
padding: space[3], | ||
}, | ||
"&:before": { | ||
display: `none`, | ||
}, | ||
"&:after": { | ||
display: `none`, | ||
}, | ||
}} | ||
> | ||
{content} | ||
<Copy | ||
fileName="Install command" | ||
content={content} | ||
css={{ borderRadius: `${radii[1]}px` }} | ||
/> | ||
</code> | ||
</pre> | ||
</div> | ||
) | ||
} | ||
|
||
export default StarterInstallation |