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

feat(ui): add prefers-color-scheme media query support#568

Merged
priscilawebdev merged 5 commits intoverdaccio:masterfrom
himanshumehta1114:master
Oct 15, 2020
Merged

feat(ui): add prefers-color-scheme media query support#568
priscilawebdev merged 5 commits intoverdaccio:masterfrom
himanshumehta1114:master

Conversation

@himanshumehta1114
Copy link
Copy Markdown
Contributor

Type: Feature

The following has been addressed in the PR:

  • see verdaccio/ui #464


const ThemeProvider: React.FC = ({ children }) => {
const isDarkModeDefault = window?.__VERDACCIO_BASENAME_UI_OPTIONS?.darkMode;
const prefersDarkMode = window?.matchMedia('(prefers-color-scheme:dark)').matches;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const prefersDarkMode = window?.matchMedia('(prefers-color-scheme:dark)').matches;
const prefersDarkMode = window.matchMedia?.('(prefers-color-scheme:dark)').matches;

after this fix, the tests will pass 😉... Good Job!! 👏

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 13, 2020

Codecov Report

Merging #568 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #568      +/-   ##
==========================================
+ Coverage   79.95%   79.96%   +0.01%     
==========================================
  Files         164      164              
  Lines        1267     1268       +1     
  Branches      243      244       +1     
==========================================
+ Hits         1013     1014       +1     
  Misses        216      216              
  Partials       38       38              
Impacted Files Coverage Δ
src/design-tokens/ThemeProvider.tsx 100.00% <100.00%> (ø)

@priscilawebdev priscilawebdev added the hacktoberfest-accepted Accept for Hacktoberfest - will merge later label Oct 15, 2020
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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

Labels

hacktoberfest-accepted Accept for Hacktoberfest - will merge later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants