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

refactor(ui): remove unnecessary store and hooks related to mobile detection #2838

Merged
merged 1 commit into from
May 26, 2023

Conversation

gustavosbarreto
Copy link
Member

No description provided.

@gustavosbarreto gustavosbarreto requested a review from a team as a code owner May 26, 2023 18:04
@gustavosbarreto gustavosbarreto force-pushed the feat/improve_navigation_drawer branch 2 times, most recently from e26418b to 1b68765 Compare May 26, 2023 18:34
@gustavosbarreto gustavosbarreto changed the title feat(ui): WIP refactor(ui): remove unnecessary store and hooks related to mobile detection May 26, 2023
…tection

* Removed a complex store that was used to determine if the browser
is mobile or not, which involved a hardcoded window width check.
Instead, I integrated the `useDisplay` composable from Vue to accurately
determine if the screen size is "lgAndUp" to display the sidebar accordingly.
This approach is more robust and reliable compared to relying on a hardcoded
value.

* Removed a bunch of hooks that were triggered by the browser's
onResize event to track window resizing. I also eliminated store-related code
related to the sidebar's state, which was primarily used for toggling the
sidebar when in mobile view.

Additionally, I made the `<AppLayout>`, pass the sidebar's visibility model
to the `<AppBar>` component using the new `defineModel` feature of Vue 3.3.

As part of the refactoring, I also converted several components to use
`<script setup>`, which offers a much cleaner code structure compared
to defineComponent usage style.
@gustavosbarreto gustavosbarreto merged commit 0b3da21 into master May 26, 2023
7 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/improve_navigation_drawer branch May 26, 2023 18:36
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.

None yet

1 participant