16
16
17
17
'use client'
18
18
19
- import { createContext , useState } from 'react'
20
- import { useAuth , useAuthLoggedUser } from "@/contexts/Auth/AuthProvider" ;
21
- import { isVarTrue } from "@/lib/isVarTrue" ;
22
19
import { Stack , Typography } from "@mui/material" ;
23
20
import ConferenceNameField from "@/components/conference/ConferenceNameField" ;
24
21
import StartConferenceButton from "@/components/conference/StartConferenceButton" ;
25
22
import CopyConferenceInfoButton from "@/components/conference/CopyConferenceInfoButton" ;
26
23
import VideoTestButton from "@/components/conference/VideoTestButton" ;
27
- import { Meeting } from "@/types/types" ;
28
24
import { t } from "i18next" ;
29
25
import "../../../i18n"
26
+ import { useContext } from "react" ;
27
+ import { ConferenceAppProps , ConferenceContext } from "@/contexts/Conference/ConferenceAppContext" ;
30
28
31
- export type MeetingContext = {
32
- loggedUser : string ,
33
- meeting : Meeting | undefined ,
34
- setMeeting : ( meeting : Meeting | undefined ) => void ,
35
- meetingName : string ,
36
- setMeetingName : ( meetingName : string ) => void ,
37
- }
38
-
39
- export const ConferenceContext = createContext < MeetingContext | null > ( null ) ;
40
29
41
30
function ConferenceActions ( ) {
42
31
43
- const {
44
- clientEnv : {
45
- NEXT_PUBLIC_VIDEO_TEST_ENABLED ,
46
- } ,
47
- } = useAuth ( ) ;
48
-
49
- const isVideoTestEnabled = isVarTrue ( NEXT_PUBLIC_VIDEO_TEST_ENABLED ) ;
50
- const { email : loggedUser } = useAuthLoggedUser ( ) ;
51
-
52
- const [ meetingName , setMeetingName ] = useState ( '' ) ;
53
- const [ meeting , setMeeting ] = useState < Meeting | undefined > ( ) ;
32
+ const { isVideoTestEnabled } = useContext ( ConferenceContext ) as ConferenceAppProps ;
54
33
55
34
return (
56
35
< >
57
- < ConferenceContext . Provider value = { {
58
- loggedUser,
59
- meeting,
60
- setMeeting,
61
- meetingName,
62
- setMeetingName
63
- } } >
64
-
36
+ < section className = "flex flex-col h-screen max-h-[48vh] items-center justify-center main-section" >
65
37
< Typography className = { 'text-white' }
66
- sx = { {
67
- fontSize : 30 ,
68
- fontWeight : 'bold ' ,
69
- marginTop : 2 ,
70
- marginBottom : 6 ,
71
- } }
38
+ sx = { {
39
+ fontSize : 40 ,
40
+ fontWeight : '700 ' ,
41
+ marginTop : 2 ,
42
+ marginBottom : 4 ,
43
+ } }
72
44
>
73
45
{ t ( 'main.title' , 'main.title' ) }
74
46
</ Typography >
@@ -84,19 +56,19 @@ function ConferenceActions() {
84
56
85
57
< Stack className = "space-y-6 w-full items-center justify-center m-4" >
86
58
< Stack className = "w-2/5 items-center justify-center" direction = { 'row' } spacing = { 0 } >
87
- < ConferenceNameField />
88
- < StartConferenceButton />
59
+ < ConferenceNameField />
60
+ < StartConferenceButton />
89
61
</ Stack >
90
62
< Stack className = "w-2/5 items-center justify-center" direction = { 'row' } spacing = { 2 } >
91
- < CopyConferenceInfoButton />
92
- { isVideoTestEnabled &&
93
- < VideoTestButton />
63
+ < CopyConferenceInfoButton />
64
+ { isVideoTestEnabled &&
65
+ < VideoTestButton />
94
66
}
95
67
</ Stack >
96
68
</ Stack >
97
- </ ConferenceContext . Provider >
69
+ </ section >
98
70
</ >
99
- )
71
+ ) ;
100
72
}
101
73
102
74
export default ConferenceActions
0 commit comments