1
1
"use client" ;
2
2
3
3
import React from "react" ;
4
+ import { cn } from "@/lib/utils" ;
4
5
import { useRouter } from "next/navigation" ;
5
6
import { useWeave } from "@inditextech/weavejs-react" ;
6
7
import { useCollaborationRoom } from "@/store/store" ;
@@ -13,7 +14,13 @@ import {
13
14
} from "@/components/ui/dropdown-menu" ;
14
15
15
16
import { Logo } from "@/components/utils/logo" ;
16
- import { Image as ImageIcon , FileText , Ellipsis , LogOut } from "lucide-react" ;
17
+ import {
18
+ Image as ImageIcon ,
19
+ FileText ,
20
+ LogOut ,
21
+ ChevronDown ,
22
+ ChevronUp ,
23
+ } from "lucide-react" ;
17
24
import { WeaveExportStageActionParams } from "@inditextech/weavejs-sdk" ;
18
25
import { ConnectionStatus } from "../connection-status" ;
19
26
@@ -25,6 +32,8 @@ export function RoomInformationOverlay() {
25
32
26
33
const room = useCollaborationRoom ( ( state ) => state . room ) ;
27
34
35
+ const [ menuOpen , setMenuOpen ] = React . useState ( false ) ;
36
+
28
37
const handleExportToImage = React . useCallback ( ( ) => {
29
38
if ( instance ) {
30
39
instance . triggerAction < WeaveExportStageActionParams > ( "exportStageTool" , {
@@ -53,22 +62,31 @@ export function RoomInformationOverlay() {
53
62
54
63
return (
55
64
< div className = "absolute top-2 left-2 flex gap-1 justify-center items-center" >
56
- < div className = "p-1 pl -3 bg-white border border-zinc-200 shadow-xs flex justify-start items-center gap-2" >
65
+ < div className = "p-2 px -3 bg-white border border-zinc-200 shadow-xs flex justify-start items-center gap-2" >
57
66
< Logo kind = "small" />
58
- < div className = "w-[1px] h-4 mx-2 bg-zinc-200" > </ div >
59
- < ConnectionStatus weaveConnectionStatus = { weaveConnectionStatus } />
60
- < div className = "flex justify-start items-center font-noto-sans-mono text-foreground !normal-case min-h-[32px] pr-2" >
61
- { room }
62
- </ div >
63
- < DropdownMenu >
64
- < DropdownMenuTrigger className = "rounded-none cursor-pointer p-2 hover:bg-zinc-200 focus:outline-none" >
65
- < Ellipsis className = "rounded-none" />
67
+ < div className = "w-[1px] h-5 mx-1 bg-zinc-200" > </ div >
68
+ < DropdownMenu onOpenChange = { ( open ) => setMenuOpen ( open ) } >
69
+ < DropdownMenuTrigger
70
+ className = { cn (
71
+ "rounded-none cursor-pointer p-2 px-3 hover:bg-accent focus:outline-none" ,
72
+ {
73
+ [ "bg-accent" ] : menuOpen ,
74
+ [ "bg-white" ] : ! menuOpen ,
75
+ }
76
+ ) }
77
+ >
78
+ < div className = "flex justify-start items-center gap-2 font-noto-sans-mono text-foreground !normal-case min-h-[32px]" >
79
+ < div className = "font-noto-sans text-xl font-extralight" >
80
+ { room }
81
+ </ div >
82
+ { menuOpen ? < ChevronUp /> : < ChevronDown /> }
83
+ </ div >
66
84
</ DropdownMenuTrigger >
67
85
< DropdownMenuContent
68
86
align = "start"
69
- side = "right "
70
- alignOffset = { - 4 }
71
- sideOffset = { 8 }
87
+ side = "bottom "
88
+ alignOffset = { 0 }
89
+ sideOffset = { 4 }
72
90
className = "font-noto-sans-mono rounded-none"
73
91
>
74
92
< DropdownMenuItem
@@ -93,6 +111,8 @@ export function RoomInformationOverlay() {
93
111
</ DropdownMenuItem >
94
112
</ DropdownMenuContent >
95
113
</ DropdownMenu >
114
+ < div className = "w-[1px] h-5 mx-1 bg-zinc-200" > </ div >
115
+ < ConnectionStatus weaveConnectionStatus = { weaveConnectionStatus } />
96
116
</ div >
97
117
</ div >
98
118
) ;
0 commit comments