🚨 front: linter empty function and react props warnings
This commit is contained in:
committed by
ericlinagora
parent
a2840f16ec
commit
1c2a56aaa1
@@ -15,7 +15,6 @@ export type DriveItemOverlayProps = {
|
||||
item: DriveItem|null;
|
||||
className: string;
|
||||
};
|
||||
export const menuBuilder = async () => {};
|
||||
|
||||
export const CheckableIcon = ({
|
||||
show,
|
||||
|
||||
@@ -11,7 +11,7 @@ export type ConfirmModalType = {
|
||||
parent_id: string;
|
||||
mode: 'move' | 'select-file' | 'select-files';
|
||||
title: string;
|
||||
onSelected: (ids: string[]) => Promise<void>;
|
||||
onSelected?: (ids: string[]) => Promise<void>;
|
||||
};
|
||||
|
||||
export const ConfirmModalAtom = atom<ConfirmModalType>({
|
||||
@@ -21,7 +21,6 @@ export const ConfirmModalAtom = atom<ConfirmModalType>({
|
||||
parent_id: '',
|
||||
mode: 'move',
|
||||
title: '',
|
||||
onSelected: async () => {},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -40,7 +39,7 @@ const ConfirmModalContent = () => {
|
||||
|
||||
const handleClose = async () => {
|
||||
setLoading(true);
|
||||
await state.onSelected(selected.map((i) => i.id));
|
||||
state.onSelected && await state.onSelected(selected.map((i) => i.id));
|
||||
setState({ ...state, open: false });
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ export type SelectorModalType = {
|
||||
parent_id: string;
|
||||
mode: 'move' | 'select-file' | 'select-files';
|
||||
title: string;
|
||||
onSelected: (ids: string[]) => Promise<void>;
|
||||
onSelected?: (ids: string[]) => Promise<void>;
|
||||
};
|
||||
|
||||
export const SelectorModalAtom = atom<SelectorModalType>({
|
||||
@@ -25,7 +25,6 @@ export const SelectorModalAtom = atom<SelectorModalType>({
|
||||
parent_id: '',
|
||||
mode: 'move',
|
||||
title: '',
|
||||
onSelected: async () => {},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -135,7 +134,7 @@ const SelectorModalContent = (key: any) => {
|
||||
className="float-right"
|
||||
onClick={async () => {
|
||||
setLoading(true);
|
||||
await state.onSelected(selected.map(i => i.id));
|
||||
state.onSelected && await state.onSelected(selected.map(i => i.id));
|
||||
setState({ ...state, open: false });
|
||||
setLoading(false);
|
||||
}}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import { fadeTransition } from 'src/utils/transitions';
|
||||
@@ -24,7 +25,6 @@ import Controls from './controls';
|
||||
interface DrivePreviewProps {
|
||||
items: DriveItem[];
|
||||
}
|
||||
|
||||
export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
|
||||
const history = useHistory();
|
||||
const company = useRouterCompany();
|
||||
@@ -64,6 +64,7 @@ export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (items.length < 2)
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
return () => {};
|
||||
addShortcut({ shortcut: 'Right', handler: handleSwitchRight });
|
||||
addShortcut({ shortcut: 'Left', handler: handleSwitchLeft });
|
||||
@@ -184,3 +185,6 @@ export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
DrivePreview.propTypes = {
|
||||
items: PropTypes.any.isRequired,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user