Skip to content

Commit

Permalink
refactor uri construct
Browse files Browse the repository at this point in the history
  • Loading branch information
sehnryr committed Dec 14, 2024
1 parent b27ef72 commit caf6752
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/Browse/ExtensionBrowse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,18 @@ const MangaItem = (
uri = "gallery://localhost";
}

const url = encodeURIComponent(manga.coverUrl);
const width = 300;
const height = 450;

return (
<Link
to={{ pathname: `/browse/${extensionId}/${manga.id}` }}
state={manga}
>
<div className="w-full aspect-[2/3] skeleton rounded-md">
<LazyImage
src={`${uri}/?url=${
encodeURIComponent(manga.coverUrl)
}&width=300&height=450`}
src={`${uri}/?url=${url}&width=${width}&height=${height}`}
alt={manga.title}
onLoad={() => setLoading(false)}
onChange={(inView) => {
Expand Down

0 comments on commit caf6752

Please sign in to comment.