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

refactor: convert Dist component to hooks #156

Merged
merged 3 commits into from
Oct 5, 2019

Conversation

bighuggies
Copy link
Contributor

@bighuggies bighuggies commented Oct 3, 2019

Type: refactor

The following has been addressed in the PR: #116

Description:
Very similar to #150

  • Convert Dist component to a function component
  • Convert DetailContext consumer to useContext hook
  • Inline render methods to simplify JSX

@codecov-io
Copy link

codecov-io commented Oct 3, 2019

Codecov Report

Merging #156 into master will decrease coverage by 0.17%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
- Coverage   83.33%   83.15%   -0.18%     
==========================================
  Files          98       98              
  Lines         948      944       -4     
  Branches      166      165       -1     
==========================================
- Hits          790      785       -5     
- Misses        141      142       +1     
  Partials       17       17
Impacted Files Coverage Δ
src/components/Dist/Dist.tsx 88.88% <88.88%> (-11.12%) ⬇️

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 583ddd5...b3642fb. Read the comment docs.

};

const chipsList = Object.keys(distDict).map((dist, key) => {
if (!distDict[dist]) return;
Copy link
Contributor Author

@bighuggies bighuggies Oct 3, 2019

Choose a reason for hiding this comment

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

Not sure if this is a bug or intentional, but this will hide the chips for file count or size if they happen to be 0. I've done a strict refactor and included the same behavior.

@bighuggies bighuggies marked this pull request as ready for review October 3, 2019 22:14
@juanpicado juanpicado self-requested a review October 4, 2019 17:22
Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

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

🚀 perfect ! thanks @bighuggies

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

Successfully merging this pull request may close these issues.

3 participants