jitsi-roomsv2/frontend/src/App.tsx

35 lines
1 KiB
TypeScript
Raw Normal View History

2023-04-10 23:28:28 +02:00
import { Provider } from 'jotai'
import { useState } from 'react'
import './App.css'
import Meeting from './components/meeting/Meeting'
import Sidebar from './components/sidebar/Sidebar'
import useBackendData from './hooks/useBackendData'
import useConferenceData from './hooks/useConferenceData'
import useLocalUser from './hooks/useLocalUser'
import { useRoomName } from './hooks/useRoomName'
2023-01-07 16:15:35 +01:00
function App() {
2023-04-10 23:28:28 +02:00
const { userInfo, setUserInfo } = useLocalUser()
const { roomData, sendMessage } = useBackendData(userInfo)
const { conferenceData, setConferenceData } = useConferenceData(sendMessage, setUserInfo)
const [meetingStarted, setMeetingStarted] = useState(false)
2023-02-07 20:31:07 +01:00
2023-04-10 23:28:28 +02:00
console.log(roomData)
2023-02-07 20:31:07 +01:00
if (roomData && userInfo) {
return (
<div className="App">
2023-04-10 23:28:28 +02:00
<Sidebar usersData={roomData} sendMessage={sendMessage} />
2023-02-12 15:28:53 +01:00
<Meeting
conferenceData={conferenceData}
setConferenceData={setConferenceData}
userInfo={userInfo}
/>
2023-02-07 20:31:07 +01:00
</div>
2023-04-10 23:28:28 +02:00
)
2023-02-07 20:31:07 +01:00
}
2023-04-10 23:28:28 +02:00
return <h2>🌀 Loading...</h2>
2023-01-07 16:15:35 +01:00
}
2023-04-10 23:28:28 +02:00
export default App