drex44 / demo-site-awesome-react-links

demo site of the npm package awesome-react-links
https://awesome-react-links.vercel.app/
MIT License
6 stars 7 forks source link

FrontEnd: make a button to copy code snippet #2

Closed drex44 closed 6 years ago

drex44 commented 6 years ago

The site is in React and it is available on here.

It shows the code snippets on the right-hand side. It is a reusable component. In this component, Add a button to copy the given code snippet just like many amazing UI libraries have.

If you have any doubts, comment below!

Apoorva-13 commented 6 years ago

can i work on this?

drex44 commented 6 years ago

yeah sure! go ahead.

Apoorva-13 commented 6 years ago

I feel we can use the package [(https://www.npmjs.com/package/react-copy-to-clipboard) ]here. Am I correct ,pls guide me ,I am new to this.

altany commented 6 years ago

Working on it without a package as this is a fairly simple task

drex44 commented 6 years ago

@Apoorva-13 the component is already there and you have to merge it there so as long as the website works it's okay to use any package. you simply have to add a button at the top corner of the div which copies the code.

drex44 commented 6 years ago

@Apoorva-13 you can submit the PR, I will review it and merge it. however, create a separate pluggable component so it can be reused elsewhere also.

drex44 commented 6 years ago

@altany and @Apoorva-13, check your site locally and then submit PR. I will merge them. develop the copyToClipboard component reusable and pluggable to keep the code modular.

altany commented 6 years ago

@drex44 I just sent a PR. Luckily I created as a separate pluggable plugin, as you suggested, and also added it to your page. Hope it is what you had in mind and you approve :)

drex44 commented 6 years ago

@Apoorva-13, are you still working on this?

Apoorva-13 commented 6 years ago

No I am not working working on this.

drex44 commented 6 years ago

okay @Apoorva-13, then I will close this issue!