11// Libraries
2- import React , { FC , useContext } from 'react'
2+ import React , { FC , useContext , useEffect } from 'react'
33import { Link } from 'react-router-dom'
44import { useSelector } from 'react-redux'
55
66// Components
7- import { Icon , TreeNav } from '@influxdata/clockface'
7+ import { Icon , IconFont , TreeNav } from '@influxdata/clockface'
88import UserWidget from 'src/pageLayout/components/UserWidget'
99import NavHeader from 'src/pageLayout/components/NavHeader'
1010import OrgSettings from 'src/cloud/components/OrgSettings'
@@ -17,6 +17,7 @@ import {getNavItemActivation} from 'src/pageLayout/utils'
1717import { getOrg } from 'src/organizations/selectors'
1818import { AppSettingContext } from 'src/shared/contexts/app'
1919import { event } from 'src/cloud/utils/reporting'
20+ import { isFlagEnabled } from 'src/shared/utils/featureFlag'
2021
2122// Types
2223import { NavItem , NavSubItem } from 'src/pageLayout/constants/navigationHierarchy'
@@ -26,6 +27,19 @@ const TreeSidebar: FC = () => {
2627 const { presentationMode, navbarMode, setNavbarMode} = useContext (
2728 AppSettingContext
2829 )
30+ useEffect ( ( ) => {
31+ if ( isFlagEnabled ( 'helpBar' ) ) {
32+ const helpBarMenu = document . querySelectorAll < HTMLElement > (
33+ '.cf-tree-nav--sub-menu-trigger'
34+ ) [ 3 ]
35+ if ( navbarMode === 'expanded' ) {
36+ helpBarMenu . style . display = 'block'
37+ helpBarMenu . style . width = '243px'
38+ } else {
39+ helpBarMenu . style . width = '44px'
40+ }
41+ }
42+ } , [ setNavbarMode , navbarMode ] )
2943
3044 if ( presentationMode || ! org ) {
3145 return null
@@ -106,6 +120,57 @@ const TreeSidebar: FC = () => {
106120 </ TreeNav . Item >
107121 )
108122 } ) }
123+ { isFlagEnabled ( 'helpBar' ) ? (
124+ < TreeNav . Item
125+ id = "support"
126+ testID = "nav-item-support"
127+ icon = { < Icon glyph = { IconFont . QuestionMark_New } /> }
128+ label = "Help & Support"
129+ shortLabel = "Support"
130+ >
131+ < TreeNav . SubMenu >
132+ < TreeNav . SubHeading label = "Support" />
133+ < TreeNav . SubItem
134+ id = "documentation"
135+ label = "Documentation"
136+ testID = "nav-subitem-documentation"
137+ linkElement = { className => < Link className = { className } to = "" /> }
138+ />
139+ < TreeNav . SubItem
140+ id = "faqs"
141+ label = "FAQs"
142+ testID = "nav-subitem-faqs"
143+ linkElement = { className => < Link className = { className } to = "" /> }
144+ />
145+ < TreeNav . SubItem
146+ id = "contactSupport"
147+ label = "Contact Support"
148+ testID = "nav-subitem-contact-support"
149+ linkElement = { className => < Link className = { className } to = "" /> }
150+ />
151+ < TreeNav . SubHeading label = "Community" />
152+ < TreeNav . SubItem
153+ id = "offcialForum"
154+ label = "Official Forum"
155+ testID = "nav-subitem-forum"
156+ linkElement = { className => < Link className = { className } to = "" /> }
157+ />
158+ < TreeNav . SubItem
159+ id = "influxdbSlack"
160+ label = "InfluxDB Slack"
161+ testID = "nav-subitem-influxdb-slack"
162+ linkElement = { className => < Link className = { className } to = "" /> }
163+ />
164+ < TreeNav . SubHeading label = "Feedback" />
165+ < TreeNav . SubItem
166+ id = "feedback"
167+ label = "Feedback & Questions"
168+ testID = "nav-subitem-feedback-questions"
169+ linkElement = { className => < Link className = { className } to = "" /> }
170+ />
171+ </ TreeNav . SubMenu >
172+ </ TreeNav . Item >
173+ ) : null }
109174 </ TreeNav >
110175 </ OrgSettings >
111176 )
0 commit comments