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

Add useTheme-hook and rewrite stuff to function-components #3902

Merged
merged 4 commits into from May 25, 2023
Merged

Conversation

eikhr
Copy link
Member

@eikhr eikhr commented May 13, 2023

There were multiple places where we were manually keeping track of the theme using an event listener and component state. I figured we should just have a hook for it to avoid repeating logic. To be able to use the new hook, I had to rewrite a few class-components to functions.

Result

Only functional change should be that Captchas now update to the new theme when changing.

Testing

  • I have thoroughly tested my changes.

Resolves ... (either GitHub issue or Linear task)

@eikhr eikhr added review-needed Pull requests that need review small-fix Pull requests that fix something small chore Pull requests that does something "boring", yet important, e.g. cleaning up code labels May 13, 2023
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

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

Clean 💯

@ivarnakken ivarnakken added the approved Pull requests that have been approved label May 14, 2023
Copy link
Member

@LudvigHz LudvigHz left a comment

Choose a reason for hiding this comment

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

Cool! Just as I commented on #3900 I saw this so good timing 😅.

Just look at using the context, otherwise looks good

app/utils/themeUtils.ts Outdated Show resolved Hide resolved
@LudvigHz LudvigHz removed the review-needed Pull requests that need review label May 15, 2023
@github-actions github-actions bot added the review-needed Pull requests that need review label May 15, 2023
@eikhr eikhr force-pushed the useTheme-util branch 2 times, most recently from 0398643 to 9ef622c Compare May 16, 2023 09:09
@eikhr eikhr added the do-not-merge/WIP Pull requests that are "work in progress", and should not be merged label May 19, 2023
eikhr added 2 commits May 25, 2023 11:07
None of the ref stuff worked, so I rewrote the form-reset thing by
adding a key, and the skipCaptcha thing seems to work without any code
in the Captcha component
@eikhr eikhr requested a review from norbye May 25, 2023 09:40
@eikhr eikhr removed the do-not-merge/WIP Pull requests that are "work in progress", and should not be merged label May 25, 2023
@eikhr eikhr merged commit faa9bc7 into master May 25, 2023
4 checks passed
@eikhr eikhr deleted the useTheme-util branch May 25, 2023 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Pull requests that have been approved chore Pull requests that does something "boring", yet important, e.g. cleaning up code review-needed Pull requests that need review small-fix Pull requests that fix something small
Projects
None yet
4 participants