11import { useMemo , useRef , useEffect , useState } from 'react'
2- import { BodyShape , PreviewCamera , PreviewEmote , PreviewOptions , PreviewProjection , PreviewType } from '@dcl/schemas'
2+ import {
3+ BodyShape ,
4+ PreviewCamera ,
5+ PreviewEmote ,
6+ PreviewOptions ,
7+ PreviewProjection ,
8+ PreviewType ,
9+ PreviewUnityMode ,
10+ } from '@dcl/schemas'
311import { SocialEmoteAnimation } from '@dcl/schemas/dist/dapps/preview/social-emote-animation'
412import { parseZoom } from '../lib/zoom'
513import { useOverrides } from './useOverrides'
614
7- export enum UnityPreviewMode {
8- PROFILE = 'profile' ,
9- MARKETPLACE = 'marketplace' ,
10- AUTHENTICATION = 'authentication' ,
11- BUILDER = 'builder' ,
12- CONFIGURATOR = 'configurator' ,
13- }
14-
1515export interface OptionsWithSource {
16- options : PreviewOptions & { mode : UnityPreviewMode | null ; disableLoader : boolean }
16+ options : PreviewOptions
1717 overrideSources : Record < string , boolean >
1818}
1919
@@ -30,13 +30,7 @@ export const useOptions = (): OptionsWithSource => {
3030 }
3131 } )
3232
33- const options = useMemo <
34- PreviewOptions & {
35- mode : UnityPreviewMode | null
36- disableLoader : boolean
37- socialEmote ?: SocialEmoteAnimation | null
38- }
39- > ( ( ) => {
33+ const options = useMemo < PreviewOptions > ( ( ) => {
4034 const autoRotateSpeedParam = searchParams . get ( 'autoRotateSpeed' ) as string | null
4135 const offsetXParam = searchParams . get ( 'offsetX' ) as string | null
4236 const offsetYParam = searchParams . get ( 'offsetY' ) as string | null
@@ -62,11 +56,7 @@ export const useOptions = (): OptionsWithSource => {
6256 }
6357 const centerBoundingBox = searchParams . get ( 'centerBoundingBox' ) !== 'false'
6458
65- const options : PreviewOptions & {
66- mode : UnityPreviewMode | null
67- disableLoader : boolean
68- socialEmote ?: SocialEmoteAnimation | null
69- } = {
59+ const options : PreviewOptions = {
7060 contractAddress : searchParams . get ( 'contract' ) ! ,
7161 tokenId : searchParams . get ( 'token' ) ,
7262 itemId : searchParams . get ( 'item' ) ,
@@ -115,7 +105,7 @@ export const useOptions = (): OptionsWithSource => {
115105 lockAlpha : lockAlpha === 'true' ,
116106 lockBeta : lockBeta === 'true' ,
117107 lockRadius : lockRadius === 'true' ,
118- mode : searchParams . get ( 'mode' ) as UnityPreviewMode | null ,
108+ unityMode : searchParams . get ( 'mode' ) as PreviewUnityMode | null ,
119109 disableLoader : searchParams . has ( 'disableLoader' ) ,
120110 username : searchParams . get ( 'username' ) ,
121111 socialEmote : ( ( ) => {
0 commit comments