zeno-ml / zeno-hub

AI Evaluation Platform
https://hub.zenoml.com
MIT License
44 stars 10 forks source link

fix: show projects only on desktop devices #643

Closed Sparkier closed 9 months ago

Sparkier commented 9 months ago

Description

fix ZEN-271

linear[bot] commented 9 months ago

ZEN-271 remove projects from homepage of hub on mobile

cabreraalex commented 9 months ago

Do we need another lib for this? ChatGPT says we can use something like this:

function isMobileDevice() {
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
Sparkier commented 9 months ago

I guess that's a philosophical question. This library is pretty tiny and does a bit more of a check than what ChatGPT told you but we could definitely just copy this part:

https://github.com/rozek/svelte-device-info/blob/517210b3ec8caa65606f066572cfb85a03841728/src/svelte-device-info.ts#L10-L15

Problem then is that we have to maintain this ourselves in case this list ever changes. I'd probably lean towards not doing optimizations like this rn but fine for me either way.

cabreraalex commented 9 months ago

SGTM!