Feature/cleanup files (#528)

* Move menu components into new dir

* Move chapter components into new dir

* Extract menu helper functions

* Move "SelectionFAB" to "collection" dir

* Move debounce hook to global utils dir

* Rename manga "hooks" to "useRefreshManga"
This commit is contained in:
schroda
2023-12-30 14:30:04 +01:00
committed by GitHub
parent ecea80f41e
commit edc2a62a76
20 changed files with 109 additions and 96 deletions

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { ListItemIcon, ListItemText, MenuItem as MuiMenuItem } from '@mui/material';
import { OverridableComponent } from '@mui/material/OverridableComponent';
import { SvgIconTypeMap } from '@mui/material/SvgIcon/SvgIcon';
interface IProps {
title: string;
Icon: OverridableComponent<SvgIconTypeMap> & { muiName: string };
onClick: () => void;
isDisabled?: boolean;
}
export const MenuItem = ({ onClick, title, Icon, isDisabled }: IProps) => (
<MuiMenuItem onClick={onClick} disabled={isDisabled}>
<ListItemIcon>
<Icon fontSize="small" />
</ListItemIcon>
<ListItemText>{title}</ListItemText>
</MuiMenuItem>
);