@@ -69,7 +69,8 @@ export function useLocalTrackRef(source: Track.Source) {
6969}
7070
7171interface TileLayoutProps {
72- chatOpen : boolean ;
72+ themeMode ?: 'dark' | 'light' ;
73+ isChatOpen : boolean ;
7374 audioVisualizerType ?: 'bar' | 'wave' | 'grid' | 'radial' | 'aura' ;
7475 audioVisualizerColor ?: `#${string } `;
7576 audioVisualizerColorShift ?: number ;
@@ -82,7 +83,8 @@ interface TileLayoutProps {
8283}
8384
8485export function TileLayout ( {
85- chatOpen,
86+ themeMode,
87+ isChatOpen,
8688 audioVisualizerType,
8789 audioVisualizerColor,
8890 audioVisualizerColorShift,
@@ -101,7 +103,7 @@ export function TileLayout({
101103 const isScreenShareEnabled = screenShareTrack && ! screenShareTrack . publication . isMuted ;
102104 const hasSecondTile = isCameraEnabled || isScreenShareEnabled ;
103105
104- const animationDelay = chatOpen ? 0 : 0.15 ;
106+ const animationDelay = isChatOpen ? 0 : 0.15 ;
105107 const isAvatar = agentVideoTrack !== undefined ;
106108 const videoWidth = agentVideoTrack ?. publication . dimensions ?. width ?? 0 ;
107109 const videoHeight = agentVideoTrack ?. publication . dimensions ?. height ?? 0 ;
@@ -114,9 +116,9 @@ export function TileLayout({
114116 < div
115117 className = { cn ( [
116118 'grid' ,
117- ! chatOpen && tileViewClassNames . agentChatClosed ,
118- chatOpen && hasSecondTile && tileViewClassNames . agentChatOpenWithSecondTile ,
119- chatOpen && ! hasSecondTile && tileViewClassNames . agentChatOpenWithoutSecondTile ,
119+ ! isChatOpen && tileViewClassNames . agentChatClosed ,
120+ isChatOpen && hasSecondTile && tileViewClassNames . agentChatOpenWithSecondTile ,
121+ isChatOpen && ! hasSecondTile && tileViewClassNames . agentChatOpenWithoutSecondTile ,
120122 ] ) }
121123 >
122124 < AnimatePresence mode = "popLayout" >
@@ -136,7 +138,7 @@ export function TileLayout({
136138 < AudioVisualizer
137139 key = "audio-visualizer"
138140 initial = { { scale : 1 } }
139- animate = { { scale : chatOpen ? 0.2 : 1 } }
141+ animate = { { scale : isChatOpen ? 0.2 : 1 } }
140142 transition = { {
141143 ...ANIMATION_TRANSITION ,
142144 delay : animationDelay ,
@@ -150,11 +152,12 @@ export function TileLayout({
150152 audioVisualizerGridRowCount = { audioVisualizerGridRowCount }
151153 audioVisualizerGridColumnCount = { audioVisualizerGridColumnCount }
152154 audioVisualizerWaveLineWidth = { audioVisualizerWaveLineWidth }
153- isChatOpen = { chatOpen }
155+ themeMode = { themeMode }
156+ isChatOpen = { isChatOpen }
154157 className = { cn (
155158 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2' ,
156159 'bg-background rounded-[50px] border border-transparent transition-[border,drop-shadow]' ,
157- chatOpen && 'border-input shadow-2xl/10 delay-200' ,
160+ isChatOpen && 'border-input shadow-2xl/10 delay-200' ,
158161 ) }
159162 style = { { color : audioVisualizerColor } }
160163 />
@@ -177,7 +180,7 @@ export function TileLayout({
177180 maskImage :
178181 'radial-gradient(circle, rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) 500px, transparent 500px)' ,
179182 filter : 'blur(0px)' ,
180- borderRadius : chatOpen ? 6 : 12 ,
183+ borderRadius : isChatOpen ? 6 : 12 ,
181184 } }
182185 transition = { {
183186 ...ANIMATION_TRANSITION ,
@@ -191,14 +194,14 @@ export function TileLayout({
191194 } }
192195 className = { cn (
193196 'overflow-hidden bg-black drop-shadow-xl/80' ,
194- chatOpen ? 'h-[90px]' : 'h-auto w-full' ,
197+ isChatOpen ? 'h-[90px]' : 'h-auto w-full' ,
195198 ) }
196199 >
197200 < VideoTrack
198201 width = { videoWidth }
199202 height = { videoHeight }
200203 trackRef = { agentVideoTrack }
201- className = { cn ( chatOpen && 'size-[90px] object-cover' ) }
204+ className = { cn ( isChatOpen && 'size-[90px] object-cover' ) }
202205 />
203206 </ motion . div >
204207 ) }
@@ -208,8 +211,8 @@ export function TileLayout({
208211 < div
209212 className = { cn ( [
210213 'grid' ,
211- chatOpen && tileViewClassNames . secondTileChatOpen ,
212- ! chatOpen && tileViewClassNames . secondTileChatClosed ,
214+ isChatOpen && tileViewClassNames . secondTileChatOpen ,
215+ ! isChatOpen && tileViewClassNames . secondTileChatClosed ,
213216 ] ) }
214217 >
215218 { /* Camera & Screen Share */ }
0 commit comments