Skip to content

Commit cabb81c

Browse files
committed
style: prettier fix
1 parent a62b4d7 commit cabb81c

29 files changed

+119
-123
lines changed

.storybook/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99

1010
framework: {
1111
name: "@storybook/react-webpack5",
12-
options: {}
12+
options: {},
1313
},
1414

1515
webpackFinal: async (config) => {
@@ -30,6 +30,6 @@ module.exports = {
3030
},
3131

3232
docs: {
33-
autodocs: true
34-
}
33+
autodocs: true,
34+
},
3535
};

.storybook/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export const parameters = {
66
date: /Date$/,
77
},
88
},
9-
}
9+
};

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ File viewer for React.
99
1010
## Supported file types
1111

12-
| Extension | MIME Type |
13-
| --------- | ---------------------------------------------------------------------------------- |
14-
| bmp | image/bmp |
15-
| csv | text/csv |
16-
| odt | application/vnd.oasis.opendocument.text |
17-
| doc | application/msword |
18-
| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
19-
| gif | image/gif |
20-
| htm | text/htm |
21-
| html | text/html |
22-
| jpg | image/jpg |
23-
| jpeg | image/jpeg |
24-
| pdf | application/pdf |
25-
| png | image/png |
26-
| ppt | application/vnd.ms-powerpoint |
12+
| Extension | MIME Type |
13+
| --------- | ------------------------------------------------------------------------- |
14+
| bmp | image/bmp |
15+
| csv | text/csv |
16+
| odt | application/vnd.oasis.opendocument.text |
17+
| doc | application/msword |
18+
| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
19+
| gif | image/gif |
20+
| htm | text/htm |
21+
| html | text/html |
22+
| jpg | image/jpg |
23+
| jpeg | image/jpeg |
24+
| pdf | application/pdf |
25+
| png | image/png |
26+
| ppt | application/vnd.ms-powerpoint |
2727
| pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation |
28-
| tiff | image/tiff |
29-
| txt | text/plain |
30-
| xls | application/vnd.ms-excel |
31-
| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
28+
| tiff | image/tiff |
29+
| txt | text/plain |
30+
| xls | application/vnd.ms-excel |
31+
| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
3232

3333
## Storybook Demo
3434

src/DocViewer.stories.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ export const WithRef = () => {
122122
};
123123

124124
export const NoRenderType = () => {
125-
const docs = [{ uri: epsFile, fileType: "application/postscript" }];
125+
const docs = [{ uri: epsFile, fileType: "application/postscript" }];
126126

127-
return (
128-
<DocViewer
129-
documents={docs}
130-
initialActiveDocument={docs[0]}
131-
pluginRenderers={DocViewerRenderers}
132-
language="en"
133-
/>
134-
);
127+
return (
128+
<DocViewer
129+
documents={docs}
130+
initialActiveDocument={docs[0]}
131+
pluginRenderers={DocViewerRenderers}
132+
language="en"
133+
/>
134+
);
135135
};

src/DocViewer.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ const DocViewer = forwardRef<DocViewerRef, DocViewerProps>((props, ref) => {
4545
<ThemeProvider
4646
theme={theme ? { ...defaultTheme, ...theme } : defaultTheme}
4747
>
48-
<Container
49-
id="react-doc-viewer"
50-
data-testid="react-doc-viewer"
51-
{...props}
52-
>
48+
<Container id="react-doc-viewer" data-testid="react-doc-viewer">
5349
<HeaderBar />
5450
<ProxyRenderer />
5551
</Container>

src/__tests__/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test("renders component with unsupported file type", () => {
2727
expect(screen.getByTestId("react-doc-viewer")).toBeDefined();
2828

2929
expect(
30-
screen.getByText("No renderer for file type: application/postscript")
30+
screen.getByText("No renderer for file type: application/postscript"),
3131
).toBeInTheDocument();
3232
});
3333

src/components/FileName.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const FileName: FC<{}> = () => {
1313

1414
const fileName = getFileName(
1515
currentDocument,
16-
config?.header?.retainURLParams || false
16+
config?.header?.retainURLParams || false,
1717
);
1818

1919
return (

src/components/HeaderBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const HeaderBar: FC<{}> = () => {
1515
const override = config?.header?.overrideComponent?.(
1616
state,
1717
() => dispatch(previousDocument()),
18-
() => dispatch(nextDocument())
18+
() => dispatch(nextDocument()),
1919
);
2020

2121
if (override) {

src/components/LoadingTimout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const LoadingTimeout: FC<PropsWithChildren> = ({ children }) => {
1111
const { state } = useContext(DocViewerContext);
1212
const { config } = state;
1313
const [shouldLoadingRender, setShouldLoadingRender] = useState(
14-
config?.loadingRenderer?.showLoadingTimeout === false
14+
config?.loadingRenderer?.showLoadingTimeout === false,
1515
);
1616

1717
useEffect(() => {
@@ -21,7 +21,7 @@ export const LoadingTimeout: FC<PropsWithChildren> = ({ children }) => {
2121
},
2222
typeof config?.loadingRenderer?.showLoadingTimeout === "number"
2323
? config.loadingRenderer.showLoadingTimeout
24-
: 500
24+
: 500,
2525
);
2626
}, [config?.loadingRenderer?.showLoadingTimeout]);
2727

src/components/ProxyRenderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ export const ProxyRenderer: FC = () => {
2121
node && dispatch(setRendererRect(node?.getBoundingClientRect()));
2222
},
2323
// eslint-disable-next-line react-hooks/exhaustive-deps
24-
[size]
24+
[size],
2525
);
2626

2727
const fileName = getFileName(
2828
currentDocument,
29-
config?.header?.retainURLParams || false
29+
config?.header?.retainURLParams || false,
3030
);
3131

3232
const Contents = () => {

0 commit comments

Comments
 (0)