processing / p5.js-web-editor

The p5.js Editor is a website for creating p5.js sketches, with a focus on making coding accessible and inclusive for artists, designers, educators, beginners, and anyone else! You can create, share, or remix p5.js sketches without needing to download or configure anything.
https://editor.p5js.org
GNU Lesser General Public License v2.1
1.3k stars 1.27k forks source link

Refactor ThemeProvider #2994

Closed adityagarg06 closed 4 months ago

adityagarg06 commented 5 months ago

Progress on #2042

Changes:

I have verified that this pull request:

lindapaiste commented 4 months ago

FYI I've held off on merging this one because I wanted to see what happened with regards to a problem in the current test code which you may have seen before where the theme value is not always set in the state. That's my mistake -- I wrote some of the test code expecting a deep merge of the Redux state and then we ended up with a shallow merge.

 PASS   client  client/modules/IDE/components/Preferences/Preferences.unit.test.jsx (13.318 s)
  ● Console

    console.error
      Warning: Failed prop type: The prop `currentTheme` is marked as required in `Provider`, but its value is `undefined`.
          in Provider (created by Connect(Provider))
          in Connect(Provider) (created by Wrapper)
          in Provider (created by Wrapper)
          in I18nextProvider (created by Wrapper)
          in Wrapper

      115 |   };
      116 |
    > 117 |   return { store, ...render(ui, { wrapper: Wrapper, ...renderOptions }) };
          |                            ^
      118 | }
      119 |
      120 | /**

I'm going to go ahead and fix that now and merge it into this branch.