Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra committed Dec 29, 2023
1 parent b73747d commit f37fc39
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/pages/signin/LoginForm/BaseLoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function LoginForm(props) {
clearDataAndFocus(clearLogin = true) {
if (!input.current) {
return;
}
}
if (clearLogin) {
Session.clearSignInData();
}
Expand Down
19 changes: 13 additions & 6 deletions src/pages/signin/LoginForm/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import PropTypes from 'prop-types';
import React from 'react';
import refPropTypes from '@components/refPropTypes';
import BaseLoginForm from './BaseLoginForm';

const propTypes = {
/** Function used to scroll to the top of the page */
scrollPageToTop: PropTypes.func,

/** A reference so we can expose clearDataAndFocus */
innerRef: refPropTypes,
};
const defaultProps = {
scrollPageToTop: undefined,
innerRef: () => {},
};

function LoginForm({innerRef, ...props}) {
<BaseLoginForm
ref={innerRef}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
function LoginForm({innerRef, ...props}) {
return (
<BaseLoginForm
ref={innerRef}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
/>
);
}

LoginForm.displayName = 'LoginForm';
Expand Down
8 changes: 4 additions & 4 deletions src/pages/signin/LoginForm/index.native.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import PropTypes from 'prop-types';
import React, {useEffect, useRef} from 'react';
import _ from 'underscore';
import AppStateMonitor from '@libs/AppStateMonitor';
import refPropTypes from '@components/refPropTypes';
import AppStateMonitor from '@libs/AppStateMonitor';
import BaseLoginForm from './BaseLoginForm';

const propTypes = {
/** Function used to scroll to the top of the page */
scrollPageToTop: PropTypes.func,

/** A reference so we can expose scrollPageToTop */
/** A reference so we can expose clearDataAndFocus */
innerRef: refPropTypes,
};
const defaultProps = {
Expand Down Expand Up @@ -43,8 +43,8 @@ function LoginForm({innerRef, ...props}) {
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
ref={(ref) => {
loginFormRef.current = ref
if (typeof innerRef === "function") {
loginFormRef.current = ref;
if (typeof innerRef === 'function') {
innerRef(ref);
} else if (innerRef && _.has(innerRef, 'current')) {
// eslint-disable-next-line no-param-reassign
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signin/SignInPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ function SignInPageInner({credentials, account, isInModal, activeClients, prefer
const navigateFocus = () => {
signInPageLayoutRef.current.scrollPageToTop();
loginFormRef.current.clearDataAndFocus();
}
};

return (
// Bottom SafeAreaView is removed so that login screen svg displays correctly on mobile.
Expand Down

0 comments on commit f37fc39

Please sign in to comment.