11import React , { useRef , useState } from "react" ;
2-
32import Link from "next/link" ;
4-
5- // headless ui
63import { Transition } from "@headlessui/react" ;
4+
5+ // mobx store
6+ import { useMobxStore } from "lib/mobx/store-provider" ;
77// hooks
8- import useTheme from "hooks/use-theme" ;
98import useOutsideClickDetector from "hooks/use-outside-click-detector" ;
109// icons
1110import { Bolt , HelpOutlineOutlined , WestOutlined } from "@mui/icons-material" ;
12- import { ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline " ;
13- import { DocumentIcon , DiscordIcon , GithubIcon } from "components/icons " ;
14- // mobx store
15- import { useMobxStore } from "lib/mobx/store-provider " ;
11+ import { DiscordIcon } from "components/icons " ;
12+ import { FileText , Github , MessagesSquare } from "lucide-react " ;
13+ // assets
14+ import packageJson from "package.json " ;
1615
1716const helpOptions = [
1817 {
1918 name : "Documentation" ,
2019 href : "https://docs.plane.so/" ,
21- Icon : DocumentIcon ,
20+ Icon : FileText ,
2221 } ,
2322 {
2423 name : "Join our Discord" ,
@@ -28,13 +27,13 @@ const helpOptions = [
2827 {
2928 name : "Report a bug" ,
3029 href : "https://github.com/makeplane/plane/issues/new/choose" ,
31- Icon : GithubIcon ,
30+ Icon : Github ,
3231 } ,
3332 {
3433 name : "Chat with us" ,
3534 href : null ,
3635 onClick : ( ) => ( window as any ) . $crisp . push ( [ "do" , "chat:show" ] ) ,
37- Icon : ChatBubbleOvalLeftEllipsisIcon ,
36+ Icon : MessagesSquare ,
3837 } ,
3938] ;
4039
@@ -123,37 +122,44 @@ export const WorkspaceHelpSection: React.FC<WorkspaceHelpSectionProps> = ({ setS
123122 leaveTo = "transform opacity-0 scale-95"
124123 >
125124 < div
126- className = { `absolute bottom-2 ${
127- store ?. theme ?. sidebarCollapsed ? "left-full" : "left-[- 75px]"
128- } space-y-2 rounded-sm bg-custom-background-80 p-1 shadow-md `}
125+ className = { `absolute bottom-2 min-w-[10rem] ${
126+ store ?. theme ?. sidebarCollapsed ? "left-full" : "- left-[75px]"
127+ } rounded bg-custom-background-100 p-1 shadow-custom-shadow-xs whitespace-nowrap divide-y divide-custom-border-200 `}
129128 ref = { helpOptionsRef }
130129 >
131- { helpOptions . map ( ( { name, Icon, href, onClick } ) => {
132- if ( href )
133- return (
134- < Link href = { href } key = { name } >
135- < a
136- target = "_blank"
137- className = "flex items-center gap-x-2 whitespace-nowrap rounded-md px-2 py-1 text-xs hover:bg-custom-background-90"
130+ < div className = "space-y-1 pb-2" >
131+ { helpOptions . map ( ( { name, Icon, href, onClick } ) => {
132+ if ( href )
133+ return (
134+ < Link href = { href } key = { name } >
135+ < a
136+ target = "_blank"
137+ className = "flex items-center gap-x-2 rounded px-2 py-1 text-xs hover:bg-custom-background-80"
138+ >
139+ < div className = "grid place-items-center flex-shrink-0" >
140+ < Icon className = "text-custom-text-200 h-3.5 w-3.5" size = { 14 } />
141+ </ div >
142+ < span className = "text-xs" > { name } </ span >
143+ </ a >
144+ </ Link >
145+ ) ;
146+ else
147+ return (
148+ < button
149+ key = { name }
150+ type = "button"
151+ onClick = { onClick ?? undefined }
152+ className = "flex w-full items-center gap-x-2 rounded px-2 py-1 text-xs hover:bg-custom-background-80"
138153 >
139- < Icon className = "h-4 w-4 text-custom-text-200" />
140- < span className = "text-sm" > { name } </ span >
141- </ a >
142- </ Link >
143- ) ;
144- else
145- return (
146- < button
147- key = { name }
148- type = "button"
149- onClick = { onClick ? onClick : undefined }
150- className = "flex w-full items-center gap-x-2 whitespace-nowrap rounded-md px-2 py-1 text-xs hover:bg-custom-background-90"
151- >
152- < Icon className = "h-4 w-4 text-custom-sidebar-text-200" />
153- < span className = "text-sm" > { name } </ span >
154- </ button >
155- ) ;
156- } ) }
154+ < div className = "grid place-items-center flex-shrink-0" >
155+ < Icon className = "text-custom-text-200 h-3.5 w-3.5" size = { 14 } />
156+ </ div >
157+ < span className = "text-xs" > { name } </ span >
158+ </ button >
159+ ) ;
160+ } ) }
161+ </ div >
162+ < div className = "px-2 pt-2 pb-1 text-[10px]" > Version: v{ packageJson . version } </ div >
157163 </ div >
158164 </ Transition >
159165 </ div >
0 commit comments