diff --git a/src/entities/unityView/ui/Unity.tsx b/src/entities/unityView/ui/Unity.tsx index e55f54f27..e4d93238f 100644 --- a/src/entities/unityView/ui/Unity.tsx +++ b/src/entities/unityView/ui/Unity.tsx @@ -1,28 +1,20 @@ -import { useEffect, useRef } from 'react'; +import { FC, useEffect, useRef } from 'react'; import UnityView from '@azesmway/react-native-unity'; +import { UnityProps } from './types'; + interface IMessage { gameObject: string; methodName: string; message: string; } -interface Props { - config: { - config: { - radius: number; - width: number; - height: number; - }; - deviceType: 'mobile' | 'tablet'; - }; -} -const Unity = (config: Props) => { +const Unity: FC<UnityProps> = ({ title, config }) => { const unityRef = useRef<UnityView>(null); useEffect(() => { - if (unityRef?.current) { + if (unityRef.current) { const message: IMessage = { gameObject: 'gameObject', methodName: 'methodName', diff --git a/src/entities/unityView/ui/types.ts b/src/entities/unityView/ui/types.ts new file mode 100644 index 000000000..ed4025fc6 --- /dev/null +++ b/src/entities/unityView/ui/types.ts @@ -0,0 +1,8 @@ +export type UnityConfig = { + file: string | null; +}; + +export type UnityProps = { + title?: string; + config: UnityConfig; +}; diff --git a/src/features/pass-survey/ui/ActivityItem.tsx b/src/features/pass-survey/ui/ActivityItem.tsx index ca1da604b..f1a9bbfd5 100644 --- a/src/features/pass-survey/ui/ActivityItem.tsx +++ b/src/features/pass-survey/ui/ActivityItem.tsx @@ -420,7 +420,7 @@ export function ActivityItem({ case 'Unity': item = ( <Box flex={1}> - <UnityView config={pipelineItem.payload} /> + <UnityView config={pipelineItem.payload} title={pipelineItem.id} /> </Box> ); break;