aboutsummaryrefslogtreecommitdiff
path: root/src/components/FileUpload/FileUpload.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-08-22 01:16:23 +0300
committereug-vs <eug-vs@keemail.me>2020-08-22 01:17:37 +0300
commit611d90f557140c442e4066e396d8c12ce4c340d3 (patch)
tree3e1281d1bbfc6729957d56f66fdb4832418ba129 /src/components/FileUpload/FileUpload.tsx
parent314ff9c134e898bcf42e277618ec813969ab84f9 (diff)
downloadwhich-ui-611d90f557140c442e4066e396d8c12ce4c340d3.tar.gz
refactor!: rewrite code without react-sage
Diffstat (limited to 'src/components/FileUpload/FileUpload.tsx')
-rw-r--r--src/components/FileUpload/FileUpload.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/FileUpload/FileUpload.tsx b/src/components/FileUpload/FileUpload.tsx
index 6a31656..d455f62 100644
--- a/src/components/FileUpload/FileUpload.tsx
+++ b/src/components/FileUpload/FileUpload.tsx
@@ -1,7 +1,7 @@
import React, { useRef } from 'react';
-import { utils } from 'react-sage';
import Button from '@material-ui/core/Button';
import CloudUpload from '@material-ui/icons/CloudUpload';
+import { getLocalFileUrl } from '../../utils/files';
interface PropTypes {
callback: (fileUrl: string, file: File) => void;
@@ -15,7 +15,7 @@ const FileUpload: React.FC<PropTypes> = ({ callback, children }) => {
const files = event.target?.files;
if (files?.length) {
const file = files[0];
- utils.loadFile(file).then(url => callback(url, file));
+ getLocalFileUrl(file).then(url => callback(url, file));
};
};