react-device-detect#isDesktop JavaScript Examples

The following examples show how to use react-device-detect#isDesktop. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppContentLayout.js    From hackertab.dev with Apache License 2.0 6 votes vote down vote up
function AppContentLayout({ setShowSettings }) {
  const { cards } = useContext(PreferencesContext)
  const [selectedCard, setSelectedCard] = useState(cards[0])

  return (
    <>
      <main className="AppContent scrollable">
        {isDesktop ? <DesktopCards cards={cards} /> : <MobileCards selectedCard={selectedCard} />}
      </main>

      <BottomNavigation
        selectedCard={selectedCard}
        setSelectedCard={setSelectedCard}
        setShowSettings={setShowSettings}
      />
    </>
  )
}