Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Add a button to copy code samples #130

Merged
merged 4 commits into from
Aug 9, 2018
Merged

Conversation

mjcuva
Copy link
Member

@mjcuva mjcuva commented Aug 2, 2018

Add a button to copy code samples!

https://www.dropbox.com/s/u30q3fxqfxiz9qs/Screenshot%202018-08-02%2015.45.09.png?raw=1

Copy link
Member

@domharrington domharrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good apart from one comment.

@@ -35,7 +37,8 @@ class CodeSample extends React.Component {
</ul>
<div className="code-sample-body">
{examplesWithLanguages.map(example => {
return (
return [
<CopyCode code={example.code} />,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not make React complain about there not being a key on the array items returned?

@domharrington domharrington mentioned this pull request Aug 9, 2018
2 tasks
@@ -57,7 +58,8 @@ class BlockCode extends React.Component {
)}

<div className="block-code-code">
{codes.map((code, i) => (
{codes.map((code, i) => [
<CopyCode code={code.code} />,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should've noticed this. Will this also have the same key problem?

@mjcuva mjcuva merged commit dc05e7c into master Aug 9, 2018
@erunion erunion deleted the enhancement/copy-code-button branch July 1, 2019 16:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants