adding copy code to code samples in rest docs (#26043)
This commit is contained in:
@@ -18,22 +18,10 @@ export function RestCodeSamples({ slug, xCodeSamples }: Props) {
|
||||
{xCodeSamples.map((sample, index) => {
|
||||
const sampleElements: JSX.Element[] = []
|
||||
if (sample.lang !== 'Ruby') {
|
||||
sampleElements.push(
|
||||
sample.lang === 'JavaScript' ? (
|
||||
<h5 key={`${sample.lang}-${index}`}>
|
||||
{sample.lang} (
|
||||
<a className="text-underline" href="https://github.com/octokit/core.js#readme">
|
||||
@octokit/core.js
|
||||
</a>
|
||||
)
|
||||
</h5>
|
||||
) : (
|
||||
<h5 key={`${sample.lang}-${index}`}>{sample.lang}</h5>
|
||||
)
|
||||
)
|
||||
sampleElements.push(
|
||||
<CodeBlock
|
||||
key={sample.lang + index}
|
||||
headingLang={sample.lang}
|
||||
codeBlock={sample.source}
|
||||
highlight={sample.lang === 'JavaScript' ? 'javascript' : 'curl'}
|
||||
></CodeBlock>
|
||||
|
||||
Reference in New Issue
Block a user