add Local source guide
This commit is contained in:
@@ -12,6 +12,7 @@ import MangaCard from './MangaCard';
|
|||||||
interface IProps{
|
interface IProps{
|
||||||
mangas: IMangaCard[]
|
mangas: IMangaCard[]
|
||||||
message?: string
|
message?: string
|
||||||
|
messageExtra?: JSX.Element
|
||||||
hasNextPage: boolean
|
hasNextPage: boolean
|
||||||
lastPageNum: number
|
lastPageNum: number
|
||||||
setLastPageNum: (lastPageNum: number) => void
|
setLastPageNum: (lastPageNum: number) => void
|
||||||
@@ -19,7 +20,7 @@ interface IProps{
|
|||||||
|
|
||||||
export default function MangaGrid(props: IProps) {
|
export default function MangaGrid(props: IProps) {
|
||||||
const {
|
const {
|
||||||
mangas, message, hasNextPage, lastPageNum, setLastPageNum,
|
mangas, message, messageExtra, hasNextPage, lastPageNum, setLastPageNum,
|
||||||
} = props;
|
} = props;
|
||||||
let mapped;
|
let mapped;
|
||||||
const lastManga = useRef<HTMLDivElement>(null);
|
const lastManga = useRef<HTMLDivElement>(null);
|
||||||
@@ -40,7 +41,12 @@ export default function MangaGrid(props: IProps) {
|
|||||||
}, [hasNextPage, mangas]);
|
}, [hasNextPage, mangas]);
|
||||||
|
|
||||||
if (mangas.length === 0) {
|
if (mangas.length === 0) {
|
||||||
mapped = <h3>{message}</h3>;
|
mapped = (
|
||||||
|
<div>
|
||||||
|
<h3>{message}</h3>
|
||||||
|
{messageExtra}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
mapped = mangas.map((it, idx) => {
|
mapped = mangas.map((it, idx) => {
|
||||||
if (idx === mangas.length - 1) {
|
if (idx === mangas.length - 1) {
|
||||||
@@ -70,4 +76,5 @@ export default function MangaGrid(props: IProps) {
|
|||||||
|
|
||||||
MangaGrid.defaultProps = {
|
MangaGrid.defaultProps = {
|
||||||
message: 'loading...',
|
message: 'loading...',
|
||||||
|
messageExtra: undefined,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -71,7 +71,19 @@ export default function SourceMangas(props: { popular: boolean }) {
|
|||||||
}, [lastPageNum]);
|
}, [lastPageNum]);
|
||||||
|
|
||||||
let message;
|
let message;
|
||||||
if (fetched) message = 'No manga was found!';
|
let messageExtra;
|
||||||
|
|
||||||
|
if (fetched) {
|
||||||
|
message = 'No manga was found!';
|
||||||
|
if (sourceId === '0') {
|
||||||
|
messageExtra = (
|
||||||
|
<>
|
||||||
|
<span>Check out </span>
|
||||||
|
<a href="https://github.com/Suwayomi/Tachidesk-Server/wiki/Local-Source">Local source guide</a>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MangaGrid
|
<MangaGrid
|
||||||
@@ -80,6 +92,7 @@ export default function SourceMangas(props: { popular: boolean }) {
|
|||||||
lastPageNum={lastPageNum}
|
lastPageNum={lastPageNum}
|
||||||
setLastPageNum={setLastPageNum}
|
setLastPageNum={setLastPageNum}
|
||||||
message={message}
|
message={message}
|
||||||
|
messageExtra={messageExtra}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user