Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "mass search" #158

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"@mui/system": "^5.0.6",
"axios": "^0.21.1",
"file-selector": "^0.2.4",
"p-queue": "^7.2.0",
"query-string": "^7.0.1",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.0.0",
Expand Down
4 changes: 0 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import Sources from 'screens/Sources';
import Extensions from 'screens/Extensions';
import NavBarContextProvider from 'components/navbar/NavBarContextProvider';
import LibraryOptionsContextProvider from 'components/library/LibraryOptionsProvider';
import SearchAll from 'screens/SearchAll';

declare module '@mui/styles/defaultTheme' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down Expand Up @@ -140,9 +139,6 @@ export default function App() {
<Route path="/sources/:sourceId/configure/">
<SourceConfigure />
</Route>
<Route path="/sources/all/search/">
<SearchAll />
</Route>
<Route path="/downloads">
<DownloadQueue />
</Route>
Expand Down
36 changes: 3 additions & 33 deletions src/components/MangaGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import React, { useEffect, useRef } from 'react';
import Grid from '@mui/material/Grid';
import EmptyView from 'components/util/EmptyView';
import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
import { Typography } from '@mui/material';
import { Box } from '@mui/system';
import MangaCard from './MangaCard';

export interface IMangaGridProps{
Expand All @@ -22,14 +20,12 @@ export interface IMangaGridProps{
lastPageNum: number
setLastPageNum: (lastPageNum: number) => void
gridLayout?: number | undefined
horisontal?: boolean | undefined
noFaces?: boolean | undefined
}

export default function MangaGrid(props: IMangaGridProps) {
const {
mangas, isLoading, message, messageExtra,
hasNextPage, lastPageNum, setLastPageNum, gridLayout, horisontal, noFaces,
hasNextPage, lastPageNum, setLastPageNum, gridLayout,
} = props;
let mapped;
const lastManga = useRef<HTMLDivElement>(null);
Expand All @@ -55,18 +51,7 @@ export default function MangaGrid(props: IMangaGridProps) {
<LoadingPlaceholder />
);
} else {
mapped = noFaces ? (
<Box
sx={{
margin: 'auto',
}}
>
<Typography variant="h5">
{message}
</Typography>
{messageExtra}
</Box>
) : (
mapped = (
<EmptyView message={message!} messageExtra={messageExtra} />
);
}
Expand All @@ -93,22 +78,7 @@ export default function MangaGrid(props: IMangaGridProps) {
}

return (
<Grid
container
spacing={1}
style={horisontal ? {
margin: 0,
width: '100%',
padding: '5px',
overflowX: 'scroll',
display: '-webkit-inline-box',
flexWrap: 'nowrap',
} : {
margin: 0,
width: '100%',
padding: '5px',
}}
>
<Grid container spacing={1} style={{ margin: 0, width: '100%', padding: '5px' }}>
{mapped}
</Grid>
);
Expand Down
23 changes: 2 additions & 21 deletions src/components/util/AppbarSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ import { IconButton, Input } from '@mui/material';
import CancelIcon from '@mui/icons-material/Cancel';
import { useQueryParam, StringParam } from 'use-query-params';

interface IProps {
autoOpen?: boolean
}

const defaultProps = {
autoOpen: false,
};

const AppbarSearch: React.FunctionComponent<IProps> = (props) => {
const { autoOpen } = props;
export default function AppbarSearch() {
const [query, setQuery] = useQueryParam('query', StringParam);
const [searchOpen, setSearchOpen] = useState(!!query);
const inputRef = React.useRef<HTMLInputElement>();
Expand Down Expand Up @@ -49,12 +40,6 @@ const AppbarSearch: React.FunctionComponent<IProps> = (props) => {
}
};

useEffect(() => {
if (autoOpen) {
openSearch();
}
}, []);

useEffect(() => {
window.addEventListener('keydown', handleSearchShortcut);

Expand Down Expand Up @@ -87,8 +72,4 @@ const AppbarSearch: React.FunctionComponent<IProps> = (props) => {
)}
</>
);
};

AppbarSearch.defaultProps = defaultProps;

export default AppbarSearch;
}
224 changes: 0 additions & 224 deletions src/screens/SearchAll.tsx

This file was deleted.

Loading