mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-22 21:11:41 +02:00
Fix formatting
Pass prettier tests
This commit is contained in:
parent
b68e622695
commit
52baa69b70
@ -2,8 +2,8 @@ import CodeEditor from 'components/CodeEditor/index';
|
|||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { sendRequest } from 'providers/ReduxStore/slices/collections/actions';
|
import { sendRequest } from 'providers/ReduxStore/slices/collections/actions';
|
||||||
import { Document, Page } from "react-pdf";
|
import { Document, Page } from 'react-pdf';
|
||||||
import { useState } from "react";
|
import { useState } from 'react';
|
||||||
import 'pdfjs-dist/build/pdf.worker';
|
import 'pdfjs-dist/build/pdf.worker';
|
||||||
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
|
import 'react-pdf/dist/esm/Page/AnnotationLayer.css';
|
||||||
import 'react-pdf/dist/esm/Page/TextLayer.css';
|
import 'react-pdf/dist/esm/Page/TextLayer.css';
|
||||||
@ -55,14 +55,11 @@ const QueryResultPreview = ({
|
|||||||
return <img src={`data:${contentType.replace(/\;(.*)/, '')};base64,${dataBuffer}`} className="mx-auto" />;
|
return <img src={`data:${contentType.replace(/\;(.*)/, '')};base64,${dataBuffer}`} className="mx-auto" />;
|
||||||
}
|
}
|
||||||
case 'preview-pdf': {
|
case 'preview-pdf': {
|
||||||
return(
|
return (
|
||||||
<div className="preview-pdf" style={{height: "100%", overflow: "auto", maxHeight:"calc(100vh - 220px)"}}>
|
<div className="preview-pdf" style={{ height: '100%', overflow: 'auto', maxHeight: 'calc(100vh - 220px)' }}>
|
||||||
<Document
|
<Document file={`data:application/pdf;base64,${dataBuffer}`} onLoadSuccess={onDocumentLoadSuccess}>
|
||||||
file ={`data:application/pdf;base64,${dataBuffer}`}
|
|
||||||
onLoadSuccess={onDocumentLoadSuccess}
|
|
||||||
>
|
|
||||||
{Array.from(new Array(numPages), (el, index) => (
|
{Array.from(new Array(numPages), (el, index) => (
|
||||||
<Page key={`page_${index + 1}`} pageNumber={index + 1} renderAnnotationLayer={false}/>
|
<Page key={`page_${index + 1}`} pageNumber={index + 1} renderAnnotationLayer={false} />
|
||||||
))}
|
))}
|
||||||
</Document>
|
</Document>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,7 +20,7 @@ const StyledWrapper = styled.div`
|
|||||||
|
|
||||||
.react-pdf__Page {
|
.react-pdf__Page {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
background-color:transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
.react-pdf__Page__textContent {
|
.react-pdf__Page__textContent {
|
||||||
border: 1px solid darkgrey;
|
border: 1px solid darkgrey;
|
||||||
|
@ -49,7 +49,7 @@ const QueryResult = ({ item, collection, data, dataBuffer, width, disableRunEven
|
|||||||
allowedPreviewModes.unshift('preview-web');
|
allowedPreviewModes.unshift('preview-web');
|
||||||
} else if (mode.includes('image')) {
|
} else if (mode.includes('image')) {
|
||||||
allowedPreviewModes.unshift('preview-image');
|
allowedPreviewModes.unshift('preview-image');
|
||||||
} else if (contentType.includes("pdf")) {
|
} else if (contentType.includes('pdf')) {
|
||||||
allowedPreviewModes.unshift('preview-pdf');
|
allowedPreviewModes.unshift('preview-pdf');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user