This repository has been archived by the owner on Apr 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.tsx
50 lines (44 loc) · 1.58 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React, { useEffect, useState } from 'react'
import Layout from '@xrengine/client/src/components/Layout/Layout'
import DefaultLayoutView from '@xrengine/client/src/components/World/DefaultLayoutView'
import { LoadEngineWithScene } from '@xrengine/client/src/components/World/LoadEngineWithScene'
import { LoadLocationScene } from '@xrengine/client/src/components/World/LoadLocationScene'
import NetworkInstanceProvisioning from '@xrengine/client/src/components/World/NetworkInstanceProvisioning'
import { useTranslation } from 'react-i18next'
import { Route, Switch } from 'react-router-dom'
interface Props {
match?: any
}
const LocationPage = (props: Props) => {
const { t } = useTranslation()
const [harmonyOpen, setHarmonyOpen] = useState(false)
const [reinit, reinitEngine] = useState(false)
const locationName = props?.match?.params?.locationName
const engineInit = () => {
reinitEngine(!reinit)
}
debugger
return (
<>
<h1>Hallo</h1>
<NetworkInstanceProvisioning locationName={locationName} />
<LoadLocationScene locationName={props.match.params.locationName} />
<LoadEngineWithScene />
<Layout
pageTitle={t('location.locationName.pageTitle')}
harmonyOpen={harmonyOpen}
setHarmonyOpen={setHarmonyOpen}
>
<DefaultLayoutView allowDebug={true} reinit={engineInit} locationName={locationName} />
</Layout>
</>
)
}
const LocationRoutes = (props) => {
return (
<Switch>
<Route path="/location/:locationName" component={LocationPage} />
</Switch>
)
}
export default LocationRoutes