mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-20 10:47:18 +03:00
Merge pull request #469 from filecoin-project/@akuokojnr/fix-nits
refactor: move unity frame props to guard code
This commit is contained in:
commit
60fc762b31
@ -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