create comic-book viewer routes
This commit is contained in:
parent
f65fcd850c
commit
48f7d6f680
4 changed files with 34 additions and 1 deletions
|
@ -30,6 +30,11 @@ const PdfViewer = React.lazy<*>(() =>
|
||||||
);
|
);
|
||||||
|
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
|
const ComicBookViewer = React.lazy<*>(() =>
|
||||||
|
import(/* webpackChunkName: "comicBookViewer" */
|
||||||
|
'component/viewers/comicBookViewer')
|
||||||
|
);
|
||||||
|
|
||||||
const ThreeViewer = React.lazy<*>(() =>
|
const ThreeViewer = React.lazy<*>(() =>
|
||||||
import(/* webpackChunkName: "threeViewer" */
|
import(/* webpackChunkName: "threeViewer" */
|
||||||
'component/viewers/threeViewer')
|
'component/viewers/threeViewer')
|
||||||
|
@ -128,6 +133,7 @@ class FileRender extends React.PureComponent<Props> {
|
||||||
const mediaTypes = {
|
const mediaTypes = {
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
'3D-file': <ThreeViewer source={{ fileType, downloadPath }} theme={currentTheme} />,
|
'3D-file': <ThreeViewer source={{ fileType, downloadPath }} theme={currentTheme} />,
|
||||||
|
'comic-book': <ComicBookViewer source={{ fileType, downloadPath }} />,
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
application: !source.url ? null : (
|
application: !source.url ? null : (
|
||||||
|
|
|
@ -334,7 +334,6 @@ class MediaPlayer extends React.PureComponent<Props, State> {
|
||||||
render() {
|
render() {
|
||||||
const { mediaType, claim } = this.props;
|
const { mediaType, claim } = this.props;
|
||||||
const { fileSource } = this.state;
|
const { fileSource } = this.state;
|
||||||
|
|
||||||
const isFileType = this.isSupportedFile();
|
const isFileType = this.isSupportedFile();
|
||||||
|
|
||||||
const isFileReady = fileSource && isFileType;
|
const isFileReady = fileSource && isFileType;
|
||||||
|
|
27
src/ui/component/viewers/comicBookViewer.jsx
Normal file
27
src/ui/component/viewers/comicBookViewer.jsx
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// @flow
|
||||||
|
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
theme: string,
|
||||||
|
source: {
|
||||||
|
stream: string => any,
|
||||||
|
fileType: string,
|
||||||
|
contentType: string,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
class ComicBookViewer extends React.PureComponent<Props> {
|
||||||
|
constructor(props: Props) {
|
||||||
|
super(props);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { source, theme } = this.props;
|
||||||
|
return <div>template</div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ComicBookViewer;
|
|
@ -55,6 +55,7 @@ class FilePage extends React.Component<Props> {
|
||||||
'script',
|
'script',
|
||||||
'document',
|
'document',
|
||||||
'3D-file',
|
'3D-file',
|
||||||
|
'comic-book',
|
||||||
// Bypass unplayable files
|
// Bypass unplayable files
|
||||||
// TODO: Find a better way to detect supported types
|
// TODO: Find a better way to detect supported types
|
||||||
'application',
|
'application',
|
||||||
|
|
Loading…
Add table
Reference in a new issue