artsy / team-navigator

An internal HR product for Artsy's team
https://team.artsy.net
MIT License
62 stars 19 forks source link

Mobile support #71

Open orta opened 7 years ago

orta commented 7 years ago

70

orta commented 7 years ago

I've not been able to figure this because of the client/server javascript with mixed inline stylesheets

Can't use @media queries without breaking the abstraction, and can't use the request navigation ID to figure out if mobile either. Any ideas @craigspaeth ?

craigspaeth commented 7 years ago

This was discussed here, you can use libraries like Radium to achieve it, but I think ideally Veact picks a favorite approach and implements it first class.

craigspaeth commented 7 years ago

FWIW you could also use state + a controller to do a device detection approach e.g.

router.use((ctx, next)=> {
  const isMobile = ctx.bootstrap(() => ctx.headers['user-agent'].match('mobile'))
  state.set({ isMobile })
  next()
})

We did something like this in Prediction at one point, but I think working media queries is better.