create comic-book viewer routes

This commit is contained in:
btzr-io 2019-05-08 16:47:39 -06:00
parent f65fcd850c
commit 48f7d6f680
4 changed files with 34 additions and 1 deletions

View file

@ -30,6 +30,11 @@ const PdfViewer = React.lazy<*>(() =>
);
// @if TARGET='app'
const ComicBookViewer = React.lazy<*>(() =>
import(/* webpackChunkName: "comicBookViewer" */
'component/viewers/comicBookViewer')
);
const ThreeViewer = React.lazy<*>(() =>
import(/* webpackChunkName: "threeViewer" */
'component/viewers/threeViewer')
@ -128,6 +133,7 @@ class FileRender extends React.PureComponent<Props> {
const mediaTypes = {
// @if TARGET='app'
'3D-file': <ThreeViewer source={{ fileType, downloadPath }} theme={currentTheme} />,
'comic-book': <ComicBookViewer source={{ fileType, downloadPath }} />,
// @endif
application: !source.url ? null : (

View file

@ -334,7 +334,6 @@ class MediaPlayer extends React.PureComponent<Props, State> {
render() {
const { mediaType, claim } = this.props;
const { fileSource } = this.state;
const isFileType = this.isSupportedFile();
const isFileReady = fileSource && isFileType;

View 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;

View file

@ -55,6 +55,7 @@ class FilePage extends React.Component<Props> {
'script',
'document',
'3D-file',
'comic-book',
// Bypass unplayable files
// TODO: Find a better way to detect supported types
'application',