2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -1,4 +1,4 @@
|
|||||||
<--!
|
<!--
|
||||||
Pull Request Checklist:
|
Pull Request Checklist:
|
||||||
- Mention what the pull request does and the rational behind the changes
|
- Mention what the pull request does and the rational behind the changes
|
||||||
- Include enough before and after images if there are visual changes
|
- Include enough before and after images if there are visual changes
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { Box, styled } from '@mui/system';
|
import { Box, styled } from '@mui/system';
|
||||||
import { Virtuoso } from 'react-virtuoso';
|
import { Virtuoso } from 'react-virtuoso';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import ChapterCard from 'components/ChapterCard';
|
|
||||||
import { CircularProgress, Fab } from '@mui/material';
|
import { CircularProgress, Fab } from '@mui/material';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import makeToast from 'components/util/Toast';
|
import makeToast from 'components/util/Toast';
|
||||||
import client from 'util/client';
|
import client from 'util/client';
|
||||||
import PlayArrow from '@mui/icons-material/PlayArrow';
|
import PlayArrow from '@mui/icons-material/PlayArrow';
|
||||||
import ChapterOptions from 'components/ChapterOptions';
|
import ChapterOptions from 'components/chapter/ChapterOptions';
|
||||||
import useLocalStorage from '../util/useLocalStorage';
|
import ChapterCard from 'components/chapter/ChapterCard';
|
||||||
|
import useLocalStorage from 'util/useLocalStorage';
|
||||||
|
|
||||||
const List = styled(Virtuoso)(({ theme }) => ({
|
const List = styled(Virtuoso)(({ theme }) => ({
|
||||||
listStyle: 'none',
|
listStyle: 'none',
|
||||||
@@ -20,7 +20,7 @@ interface IProps{
|
|||||||
setOptions: React.Dispatch<React.SetStateAction<ChapterListOptions>>
|
setOptions: React.Dispatch<React.SetStateAction<ChapterListOptions>>
|
||||||
}
|
}
|
||||||
|
|
||||||
const SortTab: [SortMode, string][] = [['source', 'By Source'], ['fetchedAt', 'By Fetch date']];
|
const SortTab: [ChapterSortMode, string][] = [['source', 'By Source'], ['fetchedAt', 'By Fetch date']];
|
||||||
|
|
||||||
export default function ChapterOptions(props: IProps) {
|
export default function ChapterOptions(props: IProps) {
|
||||||
const { options, setOptions } = props;
|
const { options, setOptions } = props;
|
||||||
@@ -48,7 +48,7 @@ export default function ChapterOptions(props: IProps) {
|
|||||||
setOptions({ ...options, active, bookmarked: newBookmarked });
|
setOptions({ ...options, active, bookmarked: newBookmarked });
|
||||||
};
|
};
|
||||||
|
|
||||||
const setSort = (newSort: SortMode) => {
|
const setSort = (newSort: ChapterSortMode) => {
|
||||||
if (newSort !== options.sortBy) {
|
if (newSort !== options.sortBy) {
|
||||||
setOptions({ ...options, sortBy: newSort });
|
setOptions({ ...options, sortBy: newSort });
|
||||||
} else {
|
} else {
|
||||||
@@ -11,7 +11,7 @@ import MangaDetails from 'components/MangaDetails';
|
|||||||
import NavbarContext from 'components/context/NavbarContext';
|
import NavbarContext from 'components/context/NavbarContext';
|
||||||
import client from 'util/client';
|
import client from 'util/client';
|
||||||
import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
|
import LoadingPlaceholder from 'components/util/LoadingPlaceholder';
|
||||||
import ChapterList from 'components/ChapterList';
|
import ChapterList from 'components/chapter/ChapterList';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
export default function Manga() {
|
export default function Manga() {
|
||||||
|
|||||||
4
src/typings.d.ts
vendored
4
src/typings.d.ts
vendored
@@ -219,7 +219,7 @@ interface PaginatedList<T> {
|
|||||||
|
|
||||||
type NullAndUndefined<T> = T | null | undefined;
|
type NullAndUndefined<T> = T | null | undefined;
|
||||||
|
|
||||||
type SortMode = 'fetchedAt' | 'source';
|
type ChapterSortMode = 'fetchedAt' | 'source';
|
||||||
|
|
||||||
interface ChapterListOptions {
|
interface ChapterListOptions {
|
||||||
active: boolean
|
active: boolean
|
||||||
@@ -227,6 +227,6 @@ interface ChapterListOptions {
|
|||||||
downloaded: NullAndUndefined<boolean>
|
downloaded: NullAndUndefined<boolean>
|
||||||
bookmarked: NullAndUndefined<boolean>
|
bookmarked: NullAndUndefined<boolean>
|
||||||
reverse: boolean
|
reverse: boolean
|
||||||
sortBy: SortMode
|
sortBy: ChapterSortMode
|
||||||
showChapterNumber: boolean
|
showChapterNumber: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user