Skip to content

Commit

Permalink
fix(deps): update react-switch to v5 (#34)
Browse files Browse the repository at this point in the history
* fix(deps): update react-switch to v5

* refactor(dark-mode-toggle): add `aria-checked` to switch component

This is purely to satisfy aXe and Lighthouse. For more information, see:

markusenglund/react-switch#34 (comment)
  • Loading branch information
renovate[bot] authored and wKovacs64 committed Apr 22, 2019
1 parent b6bbcfc commit ee4e23d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
9 changes: 0 additions & 9 deletions cypress/e2e/settings-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ function fillOutSettings(): Cypress.Chainable {
describe('Settings Page', () => {
beforeEach(() => {
cy.visit('/settings').injectAxe();
cy.configureAxe({
rules: [
{
// https://github.com/markusenglund/react-switch/issues/34
id: 'aria-required-attr',
enabled: false,
},
],
});
// wait for the content to ensure the app has been rendered
cy.get('html[lang="en"]');
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"react-dom": "16.8.6",
"react-helmet": "6.0.0-beta",
"react-icons": "3.6.0",
"react-switch": "4.1.0",
"react-switch": "5.0.0",
"react-typography": "0.16.19",
"typography": "0.16.19",
"typography-theme-moraga": "0.16.19",
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const SettingsPage: React.FunctionComponent<
<SettingLabel htmlFor="dark-mode">Dark mode:</SettingLabel>
<Switch
id="dark-mode"
aria-checked={darkMode.value}
checked={darkMode.value}
onChange={darkMode.toggle}
onColor={palette.primary}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11784,10 +11784,10 @@ react-side-effect@^1.1.0:
exenv "^1.2.1"
shallowequal "^1.0.1"

react-switch@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/react-switch/-/react-switch-4.1.0.tgz#93379df044c9febe86d0b1485cb14b2a364562b6"
integrity sha512-mINolJx85ZojtsKdH+DE+p9i073a1mQscEADF6y/FLBshSmyciZffBWP0xu8jWyqRIg7tWykFLJt+2xlMya7sw==
react-switch@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/react-switch/-/react-switch-5.0.0.tgz#ecbb666f8789cb8138b3ba1160bc3745390ab502"
integrity sha512-+zxY9xj9dMc8Y4gv/kkqQrirfEiIQ+SlQfJDW1Wi81L3xoh1fcbBYyJyh0TnhM/U/b6HxuBmkmU4Ooxgtuoavw==
dependencies:
prop-types "^15.6.2"

Expand Down

0 comments on commit ee4e23d

Please sign in to comment.