Format snippets
This commit is contained in:
@ -9,7 +9,9 @@ Detects whether the page is being viewed on a mobile device or a desktop.
|
||||
|
||||
```js
|
||||
const detectDeviceType = () =>
|
||||
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
|
||||
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
||||
navigator.userAgent
|
||||
)
|
||||
? 'Mobile'
|
||||
: 'Desktop';
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user