Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
fix: Fix eslint issues, noissue
Browse files Browse the repository at this point in the history
  • Loading branch information
diondiondion committed May 25, 2020
1 parent 14d57fa commit f3d6fe2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
plugins: ['react-hooks', 'prettier', 'jsx-a11y'],
extends: [
'5app',
'plugin:react/recommended',
Expand All @@ -18,7 +19,6 @@ module.exports = {
browser: true,
jest: true,
},
plugins: ['react-hooks', 'prettier', 'jsx-a11y'],
rules: {
'no-unused-vars': [2, {ignoreRestSiblings: true}],
'no-console': [2, {allow: ['error', 'warn']}],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"babel-plugin-styled-components": "^1.10.7",
"docz": "^2.2.0",
"eslint": "^7.0.0",
"eslint-config-5app": "^0.10.0",
"eslint-config-5app": "^0.10.1",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
Expand Down
12 changes: 9 additions & 3 deletions src/Modal/BodyScrollLock.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import {forwardRef, useContext, useLayoutEffect, useRef} from 'react';
import React, {forwardRef, useContext, useLayoutEffect, useRef} from 'react';

import {useHasMounted} from '../useHasMounted';

import {ModalStackContext} from './ModalManager';

function useScrollLockStyles({isLocked}) {
const originalScrollPosition = useRef(null);
Expand Down Expand Up @@ -30,7 +34,7 @@ function useScrollLockStyles({isLocked}) {
};
}

const BodyScrollLock = forwardRef(function InnerBodyScrollLock(props, ref) {
function InnerBodyScrollLock(props, ref) {
const {as: Component = 'div', children, style} = props;
const modalStack = useContext(ModalStackContext);
const hasModal = modalStack?.length;
Expand All @@ -44,6 +48,8 @@ const BodyScrollLock = forwardRef(function InnerBodyScrollLock(props, ref) {
{children}
</Component>
);
});
}

const BodyScrollLock = forwardRef(InnerBodyScrollLock);

export {BodyScrollLock, useScrollLockStyles};
2 changes: 2 additions & 0 deletions src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import styled from 'styled-components';
import FocusLock from 'react-focus-lock';

import Portal from '../Portal';
import CenterContent from '../CenterContent';
import {useModalManager} from './ModalManager';

const ModalWrapper = styled.div`
Expand Down

0 comments on commit f3d6fe2

Please sign in to comment.