Skip to content

Commit 96ae328

Browse files
committed
experimental: Use userAgent to calculate DEFAULT_MOBILE
1 parent 5859c5b commit 96ae328

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/MediaQueryContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useEffect, useState } from 'react';
22
import type { Logger } from './SendbirdState';
33

4-
const DEFAULT_MOBILE = false;
5-
// const DEFAULT_MOBILE = '768px';
4+
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
5+
const DEFAULT_MOBILE = isMobile;
66
const MOBILE_CLASSNAME = 'sendbird--mobile-mode';
77

88
const MediaQueryContext = React.createContext({

0 commit comments

Comments
 (0)