Skip to content
Snippets Groups Projects
Commit 25268bf7 authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

Update url image

parent 8bab05ae
No related branches found
No related tags found
No related merge requests found
......@@ -117,13 +117,13 @@ const files: ExtFile[] = [
},
{
id: 1,
name: "myself.jpg",
type: "image/jpeg",
name: "ironman.png",
type: "image/png",
size: 282000,
downloadUrl:
"https://files-ui-temp-storage.s3.amazonaws.com/2878b8d4278795cef1b66b86e687d984019742a05883f58809678df4e5a80c8f.jpg",
"https://i.pinimg.com/236x/3e/e9/46/3ee946b27fd1cc5eb0b485e4a0669534.jpg",
imageUrl:
"https://files-ui-temp-storage.s3.amazonaws.com/2878b8d4278795cef1b66b86e687d984019742a05883f58809678df4e5a80c8f.jpg",
"https://i.pinimg.com/236x/3e/e9/46/3ee946b27fd1cc5eb0b485e4a0669534.jpg",
},
];
......@@ -33,7 +33,7 @@ export default function AdvancedDropzoneDemo() {
async function checkFiles() {
try {
const res = await axios.get(
REMOTE +
LOCAL +
"/file"
);
console.log("checkFiles", res);
......@@ -55,7 +55,7 @@ export default function AdvancedDropzoneDemo() {
uploadConfig={{
/* autoUpload: true */
method: "POST",
url: REMOTE + "/file/28048465460",
url: LOCAL + "/file/28048465460",
//url: "http://localhost:2800/file/28048465460",
cleanOnUpload: true,
}}
......
......@@ -29,14 +29,14 @@ const FileMosaicImageLayer: React.FC<FileMosaicImageLayerProps> = (
//console.log("FileMosaicImageLayer", props);
const { imageSource, url, fileName, card, isBlur } = props;
const [localSource, setSource] = React.useState<string | undefined>(
const [localSource, setLocalSource] = React.useState<string | undefined>(
undefined
);
const [error, setError] = React.useState<boolean>(false);
//assign to localSource the imageSource or the url of the ile type
React.useEffect(() => {
setSource(imageSource || url);
setLocalSource(imageSource || url);
}, [imageSource, url]);
/**
......@@ -45,7 +45,8 @@ const FileMosaicImageLayer: React.FC<FileMosaicImageLayerProps> = (
*/
const handleError = () => {
setError(true);
setSource(url);
setLocalSource(url);
console.log("FileMosaicImageLayer error", url);
};
//If blur is true
......
......@@ -62,6 +62,10 @@ const ImagePreview: React.FC<ImagePreviewProps> = (
const finalHeight: string | number | undefined =
height || (orientation === "portrait" ? "100%" : undefined);
const handleError=(evt: React.SyntheticEvent<HTMLImageElement, Event>)=>{
console.log("handleError", onError);
onError?.(evt);
}
return (
<React.Fragment>
{src && source && (
......@@ -75,7 +79,7 @@ const ImagePreview: React.FC<ImagePreviewProps> = (
src={source}
alt={alt}
className={className}
onError={onError}
onError={handleError}
/>
)}
</React.Fragment>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment