Fix covers not loading
This commit is contained in:
parent
0a0e901ef7
commit
5e4e64f019
@ -45,7 +45,7 @@ export default function App(){
|
||||
? <>
|
||||
{showSearch
|
||||
? <>
|
||||
<Search createJob={CreateJob} closeSearch={() => setShowSearch(false)} />
|
||||
<Search apiUri={apiUri} createJob={CreateJob} closeSearch={() => setShowSearch(false)} />
|
||||
<hr/>
|
||||
</>
|
||||
: <></>}
|
||||
|
@ -83,7 +83,7 @@ export default function MonitorJobsList({onStartSearch, onJobsChanged, connected
|
||||
if (job === undefined || job == null)
|
||||
return <div>Error. Could not find matching job for {manga.internalId}</div>
|
||||
return <div key={"monitorMangaEntry-" + manga.internalId} className="monitorMangaEntry">
|
||||
{CoverCard(manga)}
|
||||
{CoverCard(apiUri, manga)}
|
||||
<div className="MangaActionButtons">
|
||||
<div id={"Delete-"+job.id} className="DeleteJobButton" onClick={DeleteJob}><Icon path={mdiTrashCanOutline} size={1.5} /></div>
|
||||
<div id={"Start-"+job.id} className="StartJobNowButton" onClick={StartJob}><Icon path={mdiPlayBoxOutline} size={1.5} /></div>
|
||||
|
@ -6,7 +6,7 @@ import IManga, {SearchResult} from "./interfaces/IManga";
|
||||
import '../styles/search.css';
|
||||
import '../styles/MangaSearchResult.css'
|
||||
|
||||
export default function Search({createJob, closeSearch} : {createJob: (internalId: string, type: string) => void, closeSearch(): void}) {
|
||||
export default function Search({apiUri, createJob, closeSearch} : {apiUri: string, createJob: (internalId: string, type: string) => void, closeSearch(): void}) {
|
||||
const [mangaConnectors, setConnectors] = useState<IMangaConnector[]>();
|
||||
const [selectedConnector, setSelectedConnector] = useState<IMangaConnector>();
|
||||
const [selectedLanguage, setSelectedLanguage] = useState<string>();
|
||||
@ -106,7 +106,7 @@ export default function Search({createJob, closeSearch} : {createJob: (internalI
|
||||
<div id="SearchResults">
|
||||
{searchResults === undefined
|
||||
? <p></p>
|
||||
: searchResults.map(result => SearchResult(result, createJob))}
|
||||
: searchResults.map(result => SearchResult(apiUri, result, createJob))}
|
||||
</div>
|
||||
</div>)
|
||||
}
|
@ -40,10 +40,10 @@ export function ReleaseStatusFromNumber(n: number): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
export function CoverCard(manga: IManga) : ReactElement {
|
||||
export function CoverCard(apiUri: string, manga: IManga) : ReactElement {
|
||||
return(
|
||||
<div className="Manga" key={manga.internalId}>
|
||||
<img src={Manga.GetMangaCoverUrl(manga.internalId)}></img>
|
||||
<img src={Manga.GetMangaCoverUrl(apiUri, manga.internalId)}></img>
|
||||
<div>
|
||||
<p className="pill connector-name">{manga.mangaConnector.name}</p>
|
||||
<div className="Manga-status" release-status={ReleaseStatusFromNumber(manga.releaseStatus)}></div>
|
||||
@ -52,10 +52,10 @@ export function CoverCard(manga: IManga) : ReactElement {
|
||||
</div>);
|
||||
}
|
||||
|
||||
export function SearchResult(manga: IManga, createJob: (internalId: string, type: string) => void) : ReactElement {
|
||||
export function SearchResult(apiUri: string, manga: IManga, createJob: (internalId: string, type: string) => void) : ReactElement {
|
||||
return(
|
||||
<div className="SearchResult" key={manga.internalId}>
|
||||
<img src={Manga.GetMangaCoverUrl(manga.internalId)}></img>
|
||||
<img src={Manga.GetMangaCoverUrl(apiUri, manga.internalId)}></img>
|
||||
<p className="connector-name">{manga.mangaConnector.name}</p>
|
||||
<div className="Manga-status" release-status={ReleaseStatusFromNumber(manga.releaseStatus)}></div>
|
||||
<p className="Manga-name"><a href={manga.websiteUrl}>{manga.sortName}<img src="../../media/link.svg" /></a></p>
|
||||
|
Loading…
Reference in New Issue
Block a user