Closed Keshav-0907 closed 3 months ago
I absolutely agree and you'll find some comments from me in the code like //TODO: centralize breakpoints
.
We can create and export a useIsMobile
hook that returns a boolean
.
Note that there are some places on the code where used non-standard breakpoints on purpose based on the size of the content and what fits. These aren't a problem, IMO. But we do want our standard breakpoint(s) to be declared in one place instead of everywhere.
To handle custom breakpoints, we can pass a 'customBreakpoint' parameter to 'useIsMobile' hook.
And if the customBreakpoint is provided ---> use that value; Otherwise --> use the default value of 767.
Increasing Access
Having a
centralised approach for breakpoints
will enhance the code readability, collaboration, and scalability. It will ensure a consistent and efficient approach to handling responsiveness in our project.Feature enhancement details
The current code appears to be decentralized regarding breakpoints, which may impact maintainability and consistency By consolidating breakpoints in a dedicated file, we can streamline development, making it easier to manage and update responsive design across the editor.
Approch
Using a centralised breakpoints.js
Importing the breakpoints in the components where we need to use media queries.
I want to work on this issue