mirror of
https://github.com/filecoin-project/slate.git
synced 2025-01-01 13:42:19 +03:00
refactor: move props to guard code
This commit is contained in:
parent
b804027720
commit
ddcb4e96e1
@ -59,9 +59,7 @@ export default class SlateMediaObject extends React.Component {
|
||||
const url = this.props.data.url;
|
||||
const type = this.props.data.type ? this.props.data.type : "LEGACY_NO_TYPE";
|
||||
const playType = typeMap[type] ? typeMap[type] : type;
|
||||
const unityGameConfig = this.props.data.unityGameConfig;
|
||||
const unityGameLoader = this.props.data.unityGameLoader;
|
||||
console.log(this.props.data);
|
||||
|
||||
let element = <div css={STYLES_FAILURE}>No Preview</div>;
|
||||
|
||||
if (type.startsWith("application/pdf")) {
|
||||
@ -96,6 +94,9 @@ export default class SlateMediaObject extends React.Component {
|
||||
|
||||
// TODO(jim): We will need to revisit this later.
|
||||
if (type.startsWith("application/unity")) {
|
||||
const unityGameConfig = this.props.data.unityGameConfig;
|
||||
const unityGameLoader = this.props.data.unityGameLoader;
|
||||
|
||||
return (
|
||||
<UnityFrame url={url} unityGameConfig={unityGameConfig} unityGameLoader={unityGameLoader} />
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user