add Local source guide
This commit is contained in:
@@ -12,6 +12,7 @@ import MangaCard from './MangaCard';
|
||||
interface IProps{
|
||||
mangas: IMangaCard[]
|
||||
message?: string
|
||||
messageExtra?: JSX.Element
|
||||
hasNextPage: boolean
|
||||
lastPageNum: number
|
||||
setLastPageNum: (lastPageNum: number) => void
|
||||
@@ -19,7 +20,7 @@ interface IProps{
|
||||
|
||||
export default function MangaGrid(props: IProps) {
|
||||
const {
|
||||
mangas, message, hasNextPage, lastPageNum, setLastPageNum,
|
||||
mangas, message, messageExtra, hasNextPage, lastPageNum, setLastPageNum,
|
||||
} = props;
|
||||
let mapped;
|
||||
const lastManga = useRef<HTMLDivElement>(null);
|
||||
@@ -40,7 +41,12 @@ export default function MangaGrid(props: IProps) {
|
||||
}, [hasNextPage, mangas]);
|
||||
|
||||
if (mangas.length === 0) {
|
||||
mapped = <h3>{message}</h3>;
|
||||
mapped = (
|
||||
<div>
|
||||
<h3>{message}</h3>
|
||||
{messageExtra}
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
mapped = mangas.map((it, idx) => {
|
||||
if (idx === mangas.length - 1) {
|
||||
@@ -70,4 +76,5 @@ export default function MangaGrid(props: IProps) {
|
||||
|
||||
MangaGrid.defaultProps = {
|
||||
message: 'loading...',
|
||||
messageExtra: undefined,
|
||||
};
|
||||
|
||||
@@ -71,7 +71,19 @@ export default function SourceMangas(props: { popular: boolean }) {
|
||||
}, [lastPageNum]);
|
||||
|
||||
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 (
|
||||
<MangaGrid
|
||||
@@ -80,6 +92,7 @@ export default function SourceMangas(props: { popular: boolean }) {
|
||||
lastPageNum={lastPageNum}
|
||||
setLastPageNum={setLastPageNum}
|
||||
message={message}
|
||||
messageExtra={messageExtra}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user