Skip to content

Commit

Permalink
Use jpg cover
Browse files Browse the repository at this point in the history
Signed-off-by: YouXam <[email protected]>
  • Loading branch information
YouXam committed Jun 21, 2024
1 parent f1a5ac1 commit 88f7bfe
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function ItemCard({ children, progress, onCancel }: { children: React.ReactNode,
}

function ItemCover({ src, alt, index, className, onClick }: { index?: number, src: string; alt: string, className?: string, onClick?: () => void }) {
const imgRef = useRef(null);
const [isError, setIsError] = useState(false);

return (
Expand All @@ -57,7 +56,6 @@ function ItemCover({ src, alt, index, className, onClick }: { index?: number, sr
<div className="h-full flex">
<img
alt={alt}
ref={imgRef}
loading="lazy"
src={src}
onError={(e) => {
Expand Down Expand Up @@ -192,7 +190,7 @@ export const ItemDisplay: React.FC<{ item: Item, index?: number }> = ({ item, in
<ItemCard>
<ItemCover
index={index}
src={url("cover", item.data.md5, "webp")}
src={url("cover", item.data.md5, "jpg")}
alt="书籍封面"
onClick={() => {
openDialog(url("cover", item.data.md5, "jpg"));
Expand Down Expand Up @@ -256,7 +254,7 @@ export const ItemDisplay: React.FC<{ item: Item, index?: number }> = ({ item, in
<ItemCard>
<ItemCover
index={index}
src={url("cover", item.data.md5, "webp")}
src={url("cover", item.data.md5, "jpg")}
alt="试卷封面"
onClick={() => {
openDialog(url("cover", item.data.md5, "jpg"));
Expand Down Expand Up @@ -301,7 +299,7 @@ export const ItemDisplay: React.FC<{ item: Item, index?: number }> = ({ item, in
<ItemCard>
<ItemCover
index={index}
src={url("cover", item.data.md5, "webp")}
src={url("cover", item.data.md5, "jpg")}
alt="资料封面"
onClick={() => {
openDialog(url("cover", item.data.md5, "jpg"));
Expand Down

0 comments on commit 88f7bfe

Please sign in to comment.