Concorda / concorda-dashboard

concorda dashboard
MIT License
5 stars 8 forks source link

Allow closing sidebar by clicking in the viewport #90

Closed thefoxis closed 8 years ago

thefoxis commented 8 years ago

Currently the sidebar is pretty much all CSS but it'd be great if you could click anywhere outside of it within the viewport to hide it (as you would normally by clicking the menu icon). I think it would improve the UX by fair bit, because you're not constrained by tapping on a fairly small (still tappable) icon.

Unsure how to achieve this in React so asking for help :smile:

mcdonnelldean commented 8 years ago

I think I can hook this up handy enough.

mcdonnelldean commented 8 years ago

@thefoxis I had a look at this,

I think we might need to move the sidebar up one level for this to work, specifically this line. https://github.com/nearform/concorda/blob/master/client/containers/shell.js#L33

By moving it out of the page wrapper I can attach a handler that will handle this. The problem is if I leave it you lose the ability to click anything in the sidebar. The other option is to pass the handler for this down to the children (each page). But it would need to be wired into every page which I don't think is right.

I'll update the code to make this change, I just wanted to make you aware so that if it breaks the UI it's totally my fault :(

thefoxis commented 8 years ago

@mcdonnelldean — the solution you have proposed is totally fine, will need some layout adjustments but definitely it's not a big deal so just do what's right in terms of attaching the handler and I'll deal with the rest :blush:

mcdonnelldean commented 8 years ago

No longer relevant, menu will match Vidi