Skip to content

Commit

Permalink
chore: resolve eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlight-komorebi committed Jun 2, 2021
1 parent bffcc83 commit 92e1ad1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/Tabs/Bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const MobileTabControl = ({ children }) => {
const [currentTab, setCurrentTab] = useTabs();

// eslint gets angry about using props from React.Children.map
/* eslint-disable */
// eslint also suggests using onBlur vs onChange, but i think we want the immediate change.
/* eslint-disable react/prop-types, jsx-a11y/no-onchange */
return (
<select
onChange={(e) => setCurrentTab(e.target.value)}
Expand All @@ -35,16 +36,20 @@ const MobileTabControl = ({ children }) => {
</option>
))}
</select>
/* eslint-enable react/prop-types, jsx-a11y/no-onchange */
);
/* eslint-enable */
};

MobileTabControl.propTypes = {
children: PropTypes.node.isRequired,
};

const Bar = ({ children }) => {
const detectMobile = useMobileDetect();
const isMobile = detectMobile.isMobile();

if (isMobile) {
return <MobileTabControl children={children} />;
return <MobileTabControl>{children}</MobileTabControl>;
}

return (
Expand Down

0 comments on commit 92e1ad1

Please sign in to comment.