diff --git a/src/components/Tabs/Bar.js b/src/components/Tabs/Bar.js index 9f14f0401..d79bb8571 100644 --- a/src/components/Tabs/Bar.js +++ b/src/components/Tabs/Bar.js @@ -1,21 +1,64 @@ import React from 'react'; import PropTypes from 'prop-types'; +import useMobileDetect from 'use-mobile-detect-hook'; import { css } from '@emotion/react'; -const Bar = ({ children }) => ( -
- {React.Children.map(children, (child, index) => - React.cloneElement(child, { ...child.props, index }) - )} -
-); +import useTabs from './useTabs'; + +const MobileTabControl = ({ children }) => { + const [currentTab, setCurrentTab] = useTabs(); + + return ( + + ); +}; + +const Bar = ({ children }) => { + const detectMobile = useMobileDetect(); + const isMobile = detectMobile.isMobile(); + + if (isMobile) { + return ; + } + + return ( +
+ {React.Children.map(children, (child, index) => + React.cloneElement(child, { ...child.props, index }) + )} +
+ ); +}; Bar.propTypes = { children: PropTypes.node.isRequired, diff --git a/src/components/Tabs/BarItem.js b/src/components/Tabs/BarItem.js index 3b56e20a0..e18a25b49 100644 --- a/src/components/Tabs/BarItem.js +++ b/src/components/Tabs/BarItem.js @@ -29,6 +29,10 @@ const BarItem = ({ index, children, id, count, disabled }) => { user-select: none; white-space: nowrap; + @media (max-width: 760px) { + display: block; + } + .dark-mode & { border-bottom-color: var(--color-dark-300); }