Merge pull request #469 from filecoin-project/@akuokojnr/fix-nits

refactor: move unity frame props to guard code
This commit is contained in:
CAKE 2020-12-08 22:59:14 -08:00 committed by GitHub
commit 60fc762b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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} />
);