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 a drawer with filters for mobile use on exercise overview page #893

Merged

Conversation

StijnKing
Copy link
Contributor

@StijnKing StijnKing commented Apr 1, 2024

On the exercise overview page, the filters are now placed in a drawer.

See: #466

I noticed that there is a padding for the entire page on this screen when shown in mobile format. I tried to remove that but failed. Its already there before these changes.

I refactored the code a bit and introduced a context which means that you don't have to pass the state to other components anymore. I also use a memo for the calculation of filteredExercises to prevent it from recalculating on every re-render if the data hasn't changed. Please let me know what you think.

I couldn't find how to add new translations, so I still need to translate the word Filters. How can I add such translation?

Screenshots:
image

image

@rolandgeider
Copy link
Member

oh this is great!!

To add a new translation you just need to add a new string to public/locales/en/translation.json, then do const [t, i18n] = useTranslation(); and access it somewhere with {t('foo')}

@StijnKing StijnKing force-pushed the feature/mobile-drawer-filters branch from 7a20d2e to 12c7a97 Compare April 10, 2024 19:16
On the exercise overview page, the filters are now placed
in a drawer.
@StijnKing StijnKing force-pushed the feature/mobile-drawer-filters branch from 12c7a97 to 3e48a68 Compare April 10, 2024 19:17
@StijnKing
Copy link
Contributor Author

I added the translation :)

@rolandgeider
Copy link
Member

Merged 💪🏻

@rolandgeider rolandgeider merged commit 0591708 into wger-project:master May 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants