Couchers-org / couchers

The next-generation couch surfing platform. Free forever. Community‑led. Non‑profit. Modern. Chuck us a star :)
https://couchers.org
MIT License
388 stars 79 forks source link

Remove scroll from whole app to individual scrollable components #5070

Open nabramow opened 1 week ago

nabramow commented 1 week ago

We have scroll set to the whole app rather than just in the scrollable components. This means even the nav bar scrolls, which is not what we want.

See what I mean on desktop here:

ScreenRecording2024-10-27at6 46 19PM-ezgif com-video-to-gif-converter

On mobile here:

ScreenRecording2024-10-27at11 38 40AM-ezgif com-video-to-gif-converter

We should add overflow: "hidden" to the global html and body css inAppRoute.tsx` like this:

  "@global html": {
    scrollPaddingTop: `calc(${theme.shape.navPaddingXs} + ${theme.spacing(2)})`,
    height: "100%",
    overflow: "hidden" // here
  },
  [theme.breakpoints.up("sm")]: {
    "@global html": {
      scrollPaddingTop: `calc(${theme.shape.navPaddingSmUp} + ${theme.spacing(
        2
      overflow: "hidden" // here
      )})`,
    },
  },
  "@global body": {
    height: "100%",
    overflow: "hidden" // here
  },

Right now that breaks the scroll in other places, so the main part of this ticket will be adding the overflow: "auto" to the specific components that should have it (below the nav bar) after making this change. For example the dashboard landing page no longer scrolls.

Make sure to check mobile and desktop.

bakeiro commented 1 week ago

I think this can be done in the Next.js config... it's what I did on the map, maybe makes sense to always use the same solution for the problem? (instead of multiple solutions for the same problem)

bakeiro commented 1 week ago

@nabramow

you can check here :) https://github.com/Couchers-org/couchers/blob/develop/app/web/pages/search.tsx#L34

nabramow commented 1 week ago

@nabramow

you can check here :) https://github.com/Couchers-org/couchers/blob/develop/app/web/pages/search.tsx#L34

Good point, I found the `variant: "full-width" after I wrote this. We should def see if there are other pages that should have this though still I think!

The messages one will be done in #5055.