Dzenis Hadzifejzovic 2 роки тому
джерело
коміт
9ed29742b1
1 змінених файлів з 23 додано та 16 видалено
  1. 23
    16
      src/pages/FilesPage/FilesViewPage.js

+ 23
- 16
src/pages/FilesPage/FilesViewPage.js Переглянути файл

@@ -115,10 +115,8 @@ const FilesViewPage = ({ history }) => {

const deleteFileHandler = (stream_id) => {
dispatch(deleteFileReq({ id: stream_id }));
console.log(stream_id)
console.log(file.fileStream)
if(file !== null && stream_id === file.streamId){
setFile(null)
if (file !== null && stream_id === file.streamId) {
setFile(null);
}
};

@@ -169,10 +167,10 @@ const FilesViewPage = ({ history }) => {
console.log(e, "error in file-viewer");
};

const displayFile = (fileStream,streamId) => {
setFile({fileStream,streamId});
const displayFile = (fileStream, streamId) => {
setFile({ fileStream, streamId });
};
return isLoading ? (
<div>
<div className="l-t-rectangle"></div>
@@ -254,6 +252,7 @@ const FilesViewPage = ({ history }) => {
<th>Tip dokumenta</th>
{file === null ? <th>Veličina dokumenta</th> : ""}
<th>Obrisi dokument</th>
<th>Preuzmi dokument</th>
</tr>
</thead>
<tbody>
@@ -263,7 +262,7 @@ const FilesViewPage = ({ history }) => {
<tr
key={index}
className="secondaryRow"
onClick={() => displayFile(n.file_stream,n.stream_id)}
onClick={() => displayFile(n.file_stream, n.stream_id)}
>
<td className="docs-name">{n.fileName}</td>
<td className="docs-name">{n.title}</td>
@@ -284,6 +283,22 @@ const FilesViewPage = ({ history }) => {
/>
</IconButton>
</td>
<td>
<div onClick={stopPropagation}>
<a
className="applicant-cv-button"
style={{
width: "100px",
height: "40px",
padding: 8,
}}
download={n.title}
href={`data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,${n.file_stream}`}
>
{t("common.download")}
</a>
</div>
</td>
</tr>
))}
</tbody>
@@ -304,14 +319,6 @@ const FilesViewPage = ({ history }) => {
</div>
)}
</div>
{/* <a
className="applicant-cv-button"
download={"Proba2.docx"}
href={`data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,${file2}`}
title="Download pdf document"
>
{t("common.download")} file
</a> */}
<Pagination
// size={matches ? "small" : "medium"}
size={"small"}

Завантаження…
Відмінити
Зберегти