Merge pull request #24 from CrispyBaguette/spinner
Added spinner over preview image
This commit is contained in:
commit
f27457ba70
@ -1,3 +1,5 @@
|
|||||||
|
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
interface ImagePreviewProps {
|
interface ImagePreviewProps {
|
||||||
@ -14,12 +16,20 @@ function ImagePreview({ imageData }: ImagePreviewProps) {
|
|||||||
}, [imageUrl]);
|
}, [imageUrl]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="blur-sm max-w-4xl mx-auto">
|
<div className="max-w-4xl mx-auto">
|
||||||
|
<div className="relative">
|
||||||
<img
|
<img
|
||||||
alt="preview"
|
alt="preview"
|
||||||
src={imageUrl}
|
src={imageUrl}
|
||||||
className="object-cover min-w-[70%] my-4 px-2 mx-auto"
|
className="blur-sm object-cover min-w-[70%] my-4 px-2 mx-auto"
|
||||||
/>
|
/>
|
||||||
|
<div className="absolute inset-1/2 -translate-y-12 -translate-x-12 w-24 h-24">
|
||||||
|
<FontAwesomeIcon
|
||||||
|
icon={faSpinner}
|
||||||
|
className="absolute animate-spin text-8xl"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user