freeCodeCamp / publish

> Content backend platform for /news
https://publish.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
10 stars 9 forks source link

feat: darkmode #412

Closed Sembauke closed 5 months ago

Sembauke commented 5 months ago

You can find the dark mode option in the account menu at the bottom of the navigation drawer.

closes #399

Sembauke commented 5 months ago

I am not sure what is going on with the tests

sidemt commented 5 months ago

I changed some colors when hovering table rows and buttons. Hope you don't mind 🙂

sidemt commented 5 months ago

I am not sure what is going on with the tests

So according to the copilot chat... in Next.js, every file inside the pages directory must have a default export of a React component.

The build before the tests was failing because theme.js didn't have a default export of a React component. (as far as I understood)

One of the proposed solutions was to move theme.js out of pages directory, and it worked! https://nextjs.org/docs/messages/page-without-valid-component

Nirajn2311 commented 5 months ago

One of the proposed solutions was to move theme.js out of pages directory, and it worked!

Yes that's correct and the recommended way. Basically anything inside pages is the code for the layout of individual pages. Anything else should be kept outside the folder as Next.js will attempt to render every file in pages