Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separated the copy component and added functionality to copy code in the docs section #73

Closed

Conversation

AnshumanDhiman
Copy link
Member

Fixed #39 Created a new PR, the old PR 42 was creating issues of conflicting, as discussed with @kbhutani0001 I have created a new file.

@vinayaksh42
Copy link
Member

@AnshumanDhiman is this PR same as #42?

@AnshumanDhiman
Copy link
Member Author

yes sir both the PR's are same, I was facing conflicting issues with the old PR and after force push it didn't meet up the expected changes. I had a conversation with Kartikey sir regarding this issue to open a new PR regarding this issue.

@vinayaksh42
Copy link
Member

yes sir both the PR's are same, I was facing conflicting issues with the old PR and after force push it didn't meet up the expected changes. I had a conversation with Kartikey sir regarding this issue to open a new PR regarding this issue.

Can you close your previous PR if it is no longer required?

@AnshumanDhiman
Copy link
Member Author

sure sir

@@ -491,7 +579,16 @@ const Docs = () => {
</a>
</h3>
<pre className='code language-shell'>
<code>npm install eos-icons-react</code>
<code className='copytext12 code-style'>
Copy link
Member

Choose a reason for hiding this comment

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

We have a coding convention for these type of scenarios where the class is merely used as an identifier for JS, but has no CSS styling at all. In these scenarios, we use the naming convention:
js-NAME

So, could you please add the prefix js- to all these copytextNN classes?

const LinkData = [
{
classname: '.copytext1',
link: 'npm install eos-icons --save'
Copy link
Member

Choose a reason for hiding this comment

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

I have to be honest. This is not a good practice. We are introducing a duplication of content and hence, a risk that this is not updated when something changes in the UI, thus the user would be copy-pasting old code.

We need to either use this object to populate the codesnippts, so, make this object the source. Or, my preferred solution, improve the copy function to grab the code that needs to be copied directly from its container.

@cyntss
Copy link
Member

cyntss commented Mar 22, 2022

@AnshumanDhiman always think about the scalability of your applications. All solutions need to be thought to not introduce human error when maintenance, new releases, new features come into play.

Make sure your components are ready to be re-used. Make sure your data has 1 true source. Consider new actors that don't know the codebase and how they will scale or integrate with your applications.

@AnshumanDhiman
Copy link
Member Author

@AnshumanDhiman always think about the scalability of your applications. All solutions need to be thought to not introduce human error when maintenance, new releases, new features come into play.

Make sure your components are ready to be re-used. Make sure your data has 1 true source. Consider new actors that don't know the codebase and how they will scale or integrate with your applications.

Thank you for your feedback, I will surely work on this and I will try from next time this thing won't happen again.

@cyntss
Copy link
Member

cyntss commented Mar 29, 2022

@AnshumanDhiman can you merge master into your branch to refresh it? if you get too many conflicts, feel free to close this PR and start a new one too. Whatever is the easiest for you

@AnshumanDhiman
Copy link
Member Author

AnshumanDhiman commented Mar 30, 2022

As I am having conflict issues here the code also have been updated far, I think I must close this PR and create a new PR on this. Thanks for helping😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Copy Button in the Docs Section
3 participants