leftiness / react-demo

Other
0 stars 0 forks source link

Application component should listen to browser width #42

Open leftiness opened 8 years ago

leftiness commented 8 years ago

Application component should have an onWidthChange() listener (whatever it's named) which listens to the browser API. The ApplicationContainer passes down the onWidthChange() function. Then the rest of the app will be able to ask redux about the screen size. Split it into small, medium 1000, large 1600. Then they just have to ask for the name of the size. Remember to call the onWidthChange() once after setting it up in componentWillMount so that redux gets that info for its initial state.

I was also thinking that maybe I'd want the sidebar to be open by default if the screen is wide enough. If they toggle it closed, then it'll still get closed.

http://www.sitepoint.com/javascript-media-queries/