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

refactor: added reusable Card class to reduce code & test duplication #260

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

anuraghazra
Copy link
Owner

With our current approach we have to handle hide_title, hide_border and auto height adjustment logics with each card and this is causing lot of duplication in code & tests too, thats why i've created a Card.js Class to abstract away the common rendering logic.

The Card class would automatically handle the hide title, hide border logic as well has when hiding the title it will auto adjust the content & card's height accordingly.

@anuraghazra anuraghazra added the enhancement New feature or request. label Jul 29, 2020
@codecov
Copy link

codecov bot commented Jul 29, 2020

Codecov Report

Merging #260 into master will decrease coverage by 0.31%.
The diff coverage is 95.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #260      +/-   ##
==========================================
- Coverage   95.18%   94.86%   -0.32%     
==========================================
  Files          15       16       +1     
  Lines         415      467      +52     
  Branches      122      123       +1     
==========================================
+ Hits          395      443      +48     
- Misses         16       20       +4     
  Partials        4        4              
Impacted Files Coverage Δ
api/top-langs.js 100.00% <ø> (ø)
src/getStyles.js 52.94% <80.00%> (-0.40%) ⬇️
src/Card.js 93.18% <93.18%> (ø)
src/renderRepoCard.js 100.00% <100.00%> (ø)
src/renderStatsCard.js 100.00% <100.00%> (ø)
src/renderTopLanguages.js 100.00% <100.00%> (ø)

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 34b5dcb...47d418e. Read the comment docs.

readme.md Show resolved Hide resolved
@anuraghazra anuraghazra merged commit 3b0f1b1 into master Jul 30, 2020
@anuraghazra anuraghazra deleted the refactor-card branch October 31, 2020 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant