Refactor/116 RegistryInfoContent is converted to functional component#229
Refactor/116 RegistryInfoContent is converted to functional component#229juanpicado merged 18 commits intoverdaccio:masterfrom alfonsoar:refactor/116_registry_info_content_is_converted_to_functional_component
Conversation
Codecov Report
@@ Coverage Diff @@
## master #229 +/- ##
=========================================
+ Coverage 88.85% 88.9% +0.04%
=========================================
Files 139 139
Lines 915 919 +4
Branches 142 160 +18
=========================================
+ Hits 813 817 +4
+ Misses 91 87 -4
- Partials 11 15 +4
|
|
@priscilawebdev @juanpicado please review. |
src/components/RegistryInfoContent/RegistryInfoContent.test.tsx
Outdated
Show resolved
Hide resolved
src/components/RegistryInfoContent/RegistryInfoContent.test.tsx
Outdated
Show resolved
Hide resolved
|
@agar23 thank you very much for your contribution 🙂👏I would apply just a few minor changes ... please check my comments :-) |
np, I addressed most of the comments. but had a couple of questions/comments I left. |
| return packages.map(({ name, version, description, time, keywords, dist, homepage, bugs, author, license }, i) => { | ||
| // TODO: move format license to API side. | ||
| const license = formatLicense(pkg.license); | ||
| const _license = formatLicense(license); |
There was a problem hiding this comment.
Please why did you add _ ?
There was a problem hiding this comment.
we cant name this variable license the props already have a prop named license I presume this why the component was not destructuring the props before. this way we could call pkg.license
| ); | ||
| } | ||
| const RegistryInfoContent: React.FC<Props> = props => { | ||
| const [tabPosition, setTabPosition] = useState<State['tabPosition']>(0); |
There was a problem hiding this comment.
| const [tabPosition, setTabPosition] = useState<State['tabPosition']>(0); | |
| const [tabPosition, setTabPosition] = useState(0); |
There was a problem hiding this comment.
as discussed I think it should be ok to be explicit here
|
@agar23 almost there :-) |
|
@agar23 great job, there are one conflict and seems linting is failing :) looking forward to merge it soon :) |
…tional_component' of github.com:agar23/ui into refactor/116_registry_info_content_is_converted_to_functional_component
…erted_to_functional_component
Type: Refactor
The following has been addressed in the PR:
Description:
Refactor RegistryInfoContent compoenent to functional