-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6dc559
commit 00aecee
Showing
24 changed files
with
2,386 additions
and
2,008 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// copy all src/files to out/src | ||
|
||
const fs = require("fs"); | ||
const path = require("path"); | ||
const { execSync } = require("child_process"); | ||
|
||
const srcDir = path.join(__dirname, "../src"); | ||
const outDir = path.join(__dirname, "../out/src"); | ||
|
||
fs.cpSync(srcDir, outDir, { recursive: true }); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IDocxViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const DocxViewer = ({ filePath }: IDocxViewerProps): JSX.Element => { | ||
return (<div>Docx viewer: {filePath}</div>); | ||
} | ||
return <div>Docx viewer: {filePath}</div>; | ||
}; | ||
|
||
export default DocxViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IHtmlViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const HtmlViewer = ({ filePath }: IHtmlViewerProps): JSX.Element => { | ||
return (<div>pdf viewer: {filePath}</div>); | ||
} | ||
return <div>pdf viewer: {filePath}</div>; | ||
}; | ||
|
||
export default HtmlViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IImageViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const ImageViewer = ({ filePath }: IImageViewerProps): JSX.Element => { | ||
return (<div>Image viewer: {filePath}</div>); | ||
} | ||
return <div>Image viewer: {filePath}</div>; | ||
}; | ||
|
||
export default ImageViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IMarkdownViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const MarkdownViewer = ({ filePath }: IMarkdownViewerProps): JSX.Element => { | ||
return (<div>Markdown viewer: {filePath}</div>); | ||
} | ||
return <div>Markdown viewer: {filePath}</div>; | ||
}; | ||
|
||
export default MarkdownViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,30 @@ | ||
import React, { useEffect } from 'react'; | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import React, { useEffect, JSX } from "react"; | ||
import { useDispatch, useSelector } from "react-redux"; | ||
|
||
import { readAssetRequest } from '../../Store/ActionCreators/FilesActionCreators'; | ||
import { IAppState } from '../../Store/Reducers'; | ||
import { readAssetRequest } from "../../Store/ActionCreators/FilesActionCreators"; | ||
import { IAppState } from "../../Store/Reducers"; | ||
|
||
export interface IPdfViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const PdfViewer = ({ filePath }: IPdfViewerProps): JSX.Element => { | ||
const dispatch = useDispatch(); | ||
const content = useSelector<IAppState, any>(state => state.files.files?.[filePath]?.content); | ||
const dispatch = useDispatch(); | ||
const content = useSelector<IAppState, any>((state) => state.files.files?.[filePath]?.content); | ||
|
||
useEffect(() => { | ||
dispatch(readAssetRequest(filePath)); | ||
}, [filePath]); | ||
useEffect(() => { | ||
dispatch(readAssetRequest(filePath)); | ||
}, [filePath]); | ||
|
||
if (!content) return <div>Loading...</div>; | ||
if (!content) return <div>Loading...</div>; | ||
|
||
return ( | ||
<div id="pdf-preview-container"> | ||
<object | ||
data={`${content}#toolbar=0&navpanes=1`} | ||
type="application/pdf" | ||
className="preview-object" | ||
> | ||
<embed | ||
src={`${content}#toolbar=0&navpanes=1`} | ||
type="application/pdf" /> | ||
</object> | ||
</div > | ||
); | ||
} | ||
return ( | ||
<div id="pdf-preview-container"> | ||
<object data={`${content}#toolbar=0&navpanes=1`} type="application/pdf" className="preview-object"> | ||
<embed src={`${content}#toolbar=0&navpanes=1`} type="application/pdf" /> | ||
</object> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PdfViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IPlaintextViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const PlaintextViewer = ({ filePath }: IPlaintextViewerProps): JSX.Element => { | ||
return (<div>Plaintext viewer: {filePath}</div>); | ||
} | ||
return <div>Plaintext viewer: {filePath}</div>; | ||
}; | ||
|
||
export default PlaintextViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IVideoViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const VideoViewer = ({ filePath }: IVideoViewerProps): JSX.Element => { | ||
return (<div>Video viewer: {filePath}</div>); | ||
} | ||
return <div>Video viewer: {filePath}</div>; | ||
}; | ||
|
||
export default VideoViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React, { JSX } from "react"; | ||
|
||
export interface IXlsxViewerProps { | ||
filePath: string | ||
filePath: string; | ||
} | ||
|
||
const XlsxViewer = ({ filePath }: IXlsxViewerProps): JSX.Element => { | ||
return (<div>Xlsx viewer: {filePath}</div>); | ||
} | ||
return <div>Xlsx viewer: {filePath}</div>; | ||
}; | ||
|
||
export default XlsxViewer; |
Oops, something went wrong.