remove unnecessary React imports
This commit is contained in:
parent
aaa96ea27b
commit
6946845ac7
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { DRAWER_WIDTH } from './components/Sidebar/contants';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import clsx from 'clsx';
|
||||
import { Route } from 'config/routing';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import { useAuth } from 'libs/auth';
|
||||
|
||||
import { Box, Typography } from '@material-ui/core';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { Fragment, useState, memo } from 'react';
|
||||
import { Fragment, useState, memo } from 'react';
|
||||
import { useLocation, matchPath } from 'react-router-dom';
|
||||
import { Route } from './types';
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import { Route } from './types';
|
||||
|
||||
import { List } from '@material-ui/core';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { useAuth } from 'libs/auth';
|
||||
import { Route } from 'config/routing';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useRef } from 'react';
|
||||
import { useRef } from 'react';
|
||||
|
||||
import {
|
||||
TextField,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { forwardRef, RefObject } from 'react';
|
||||
import { forwardRef, RefObject } from 'react';
|
||||
import {
|
||||
Link as RRDLink,
|
||||
LinkProps as RRDLinkProps,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import { validateRowsPerPage, isObjKey } from './helpers';
|
||||
import { Action, Column, OrderDirection } from './types';
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import React from 'react';
|
||||
|
||||
import { TableRow, TableCell, Typography } from '@material-ui/core';
|
||||
|
||||
function TableEmpty() {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import React from 'react';
|
||||
|
||||
import {
|
||||
TablePagination,
|
||||
TableRow,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import { Column, OrderDirection } from './types';
|
||||
|
||||
import {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import { Fragment } from 'react';
|
||||
|
||||
import { TableRow, TableCell } from '@material-ui/core';
|
||||
import { Skeleton } from '@material-ui/lab';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import { get, isString, isNumber } from 'lodash';
|
||||
import { format } from 'date-fns';
|
||||
import formatNumber from 'utils/formatNumber';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import { Route } from 'config/routing';
|
||||
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
|
|
|
@ -97,9 +97,7 @@ const useProfessionAutocomplete = ({ qualificationID, control }: Options) => {
|
|||
|
||||
return {
|
||||
professions,
|
||||
get loading() {
|
||||
return this.professions.length === 0 && loading;
|
||||
},
|
||||
loading: professions.length === 0 && loading,
|
||||
isLoadingSuggestions,
|
||||
suggestions,
|
||||
setSearch,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { useMemo } from 'react';
|
||||
import { useQuery } from '@apollo/client';
|
||||
import { QUERY_QUALIFICATIONS } from './queries';
|
||||
import { Query, QueryQualificationsArgs } from 'libs/graphql/types';
|
||||
|
@ -8,16 +9,14 @@ const useQualifications = () => {
|
|||
QueryQualificationsArgs
|
||||
>(QUERY_QUALIFICATIONS, {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
variables: {
|
||||
sort: ['id ASC'],
|
||||
},
|
||||
});
|
||||
const qualifications = useMemo(() => data?.qualifications.items ?? [], [
|
||||
data,
|
||||
]);
|
||||
|
||||
return {
|
||||
qualifications: data?.qualifications.items ?? [],
|
||||
get loading() {
|
||||
return this.qualifications.length === 0 && loading;
|
||||
},
|
||||
qualifications,
|
||||
loading: qualifications.length === 0 && loading,
|
||||
total: data?.qualifications.total ?? 0,
|
||||
refetch,
|
||||
};
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { BrowserRouter, Route } from 'react-router-dom';
|
||||
import { ApolloProvider } from '@apollo/client';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useMemo, useState, useEffect } from 'react';
|
||||
import { useMemo, useState, useEffect } from 'react';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
import { isFunction } from 'lodash';
|
||||
import { context as Context } from './context';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import { createContext, useContext } from 'react';
|
||||
import { AuthContext } from './types';
|
||||
import TokenStorage from '../tokenstorage/TokenStorage';
|
||||
|
||||
const ctx = React.createContext<AuthContext>({
|
||||
const ctx = createContext<AuthContext>({
|
||||
tokenStorage: new TokenStorage(),
|
||||
signIn: () => new Promise(resolve => resolve(null)),
|
||||
signOut: () => new Promise(resolve => resolve()),
|
||||
|
@ -12,7 +12,7 @@ const ctx = React.createContext<AuthContext>({
|
|||
ctx.displayName = 'AuthContext';
|
||||
|
||||
const useAuth = (): AuthContext => {
|
||||
return React.useContext(ctx);
|
||||
return useContext(ctx);
|
||||
};
|
||||
|
||||
export { ctx as context, useAuth };
|
||||
|
|
Reference in New Issue