Closed
Description
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
const breakpoints = {
mobile: 767,
tablet: 1024, // Just for reference, as we don't have distinct breakpoints for tablets now
};
Importing the breakpoints in the components where we need to use media queries.
import breakpoints from './breakpoints';
const aRandomComponent = () => {
const isMobile = useMediaQuery({ maxWidth: breakpoints.mobile });
....
};