summaryrefslogtreecommitdiff
path: root/src/core/components/views/MobileView.jsx
blob: be8aa293c19d0973c3957bb762356b2dc1745b7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import isMobile from 'is-mobile'
import { useEffect, useState } from 'react'

const MobileView = ({ children }) => {
  const [view, setView] = useState(<></>)

  useEffect(() => {
    if (isMobile()) setView(children)
  }, [children])

  return view
}

export default MobileView