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