I'm building a react application and using bootstrap. Unfortunately, one of my pages features a google map + list on desktop, but on mobile I want to show EITHER the map or the list (using a toggle).
On desktop, the map takes up about 75% of the container width, and the list takes up the remaining 25%.
My solution right now involves using three classes - desktop
, mobile-list
(shows only the list), and mobile-map
(shows only the map). I use display: none
on the desktop
class when its mobile view.
On the mobile breakpoints, the view changes based on the current state in my reducer based on whether the user has toggled list or not.
Is there a more elegant way to do this? I'm worried that if the styles fail for some reason its going to look awful.