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

[Add] props description, descriptions to the component. #3112

Conversation

khushal87
Copy link
Member

What kind of change does this PR introduce?
This PR introduces adding descriptions and props descriptions to the components for auto-generation of docs in the future.

Did you add tests for your changes?
Yes, I have added and configured the tests accordingly.

If relevant, did you update the documentation?
Not required.

Summary
This PR added descriptions and props description to the components except for the class-based components:

  • Image
  • Input
  • Searchbar
  • Tooltip

Does this PR introduce a breaking change?
No.

Other information
Nothing as such. I have used a common pattern for commenting on the descriptions in the components.

Tags
#gsoc #docs-autogen #khushal87

@arpitBhalla
Copy link
Member

@khushal87 Could you add this feature too? #3105 (comment)

@khushal87
Copy link
Member Author

@arpitBhalla This is not decided yet, I will have to talk to mentors. Adding all this will unnecessarily make the component long with descriptions in my opinion.

@arpitBhalla
Copy link
Member

@khushal87 Its already decided in #3004

@arpitBhalla
Copy link
Member

definitely adding single line for preview would not make description lengthy

@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #3112 (ee3aa1e) into next (34c6936) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #3112   +/-   ##
=======================================
  Coverage   83.84%   83.84%           
=======================================
  Files          78       78           
  Lines        1684     1684           
  Branches      669      669           
=======================================
  Hits         1412     1412           
  Misses        268      268           
  Partials        4        4           
Impacted Files Coverage Δ
src/AirbnbRating/AirbnbRating.tsx 0.00% <ø> (ø)
src/Avatar/Accessory.tsx 30.00% <ø> (ø)
src/Avatar/Avatar.tsx 100.00% <ø> (ø)
src/Badge/Badge.tsx 100.00% <ø> (ø)
src/Badge/withBadge.tsx 100.00% <ø> (ø)
src/BottomSheet/BottomSheet.tsx 100.00% <ø> (ø)
src/Button/Button.tsx 96.36% <ø> (ø)
src/ButtonGroup/ButtonGroup.tsx 100.00% <ø> (ø)
src/Card/CardBase.tsx 42.85% <ø> (ø)
src/Card/CardDivider.tsx 75.00% <ø> (ø)
... and 40 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34c6936...ee3aa1e. Read the comment docs.

@@ -14,10 +14,15 @@ import { RneFunctionComponent } from '../helpers';

export type AccessoryProps = Partial<IconProps> &
Partial<ImageProps> & {
/**Add underlay color to the accessory of avatar. */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**Add underlay color to the accessory of avatar. */
/** Add underlay color to the accessory of avatar. */

Copy link
Member

Choose a reason for hiding this comment

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

@khushal87 Can you make this change everywhere? You can find and replace all.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dhruvdutt Done, thanks for pointing it out. 🙌

@arpitBhalla
Copy link
Member

@dhruvdutt Can we add preview images and documentation links to description, it would be easy for developer to quickly access docs.

@khushal87
Copy link
Member Author

@arpitBhalla The problem with this is that it will also be visible in documentation after parse unless and until we remove it by adding additional conditions. I don't think making the code complex is a good thing, where we already have an underlying props filter complexity which we would be having. Docs are enough to show what the components are used for. This is my opinion. @dhruvdutt what do you say?

@arpitBhalla
Copy link
Member

I don't think making the code complex

removing 2 lines would not be complex, you can do it after generating markdown files, I guess 🙄

@dhruvdutt
Copy link
Member

@arpitBhalla Adding preview image & description link can be picked up separately as an enhancement later. Let's track it at #3115 and add it for all components together since this would need some changes in the comments parsing for filtering during auto-generation of docs.

@khushal87 khushal87 mentioned this pull request Jul 1, 2021
4 tasks
@pranshuchittora pranshuchittora merged commit 7e90dac into react-native-elements:next Jul 1, 2021
@khushal87 khushal87 deleted the khushal87-docs-autogen-scripts-1 branch July 3, 2021 16:57
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.

5 participants