@@ -10,6 +10,7 @@ import {
10
10
getUniqueId ,
11
11
Icon ,
12
12
ProgressBar ,
13
+ SidePanelTab ,
13
14
useMainContext ,
14
15
useTheme ,
15
16
} from '@devtron-labs/devtron-fe-common-lib'
@@ -20,7 +21,7 @@ export const SidePanelDocumentation = ({ SidePanelHeaderActions }: SidePanelCont
20
21
// HOOKS
21
22
const { appTheme } = useTheme ( )
22
23
const {
23
- sidePanelConfig : { docLink : sidePanelDocLink , reinitialize } ,
24
+ sidePanelConfig : { state , docLink : sidePanelDocLink , reinitialize } ,
24
25
setSidePanelConfig,
25
26
} = useMainContext ( )
26
27
@@ -53,20 +54,22 @@ export const SidePanelDocumentation = ({ SidePanelHeaderActions }: SidePanelCont
53
54
54
55
return (
55
56
< >
56
- < SidePanelHeaderActions >
57
- < Button
58
- dataTestId = "open-in-new-tab-button"
59
- ariaLabel = "Open in new tab"
60
- icon = { < Icon name = "ic-arrow-square-out" color = { null } /> }
61
- variant = { ButtonVariantType . borderLess }
62
- style = { ButtonStyleType . neutral }
63
- size = { ComponentSizeType . xs }
64
- component = { ButtonComponentType . anchor }
65
- anchorProps = { {
66
- href : docLink ,
67
- } }
68
- />
69
- </ SidePanelHeaderActions >
57
+ { state === SidePanelTab . DOCUMENTATION && (
58
+ < SidePanelHeaderActions >
59
+ < Button
60
+ dataTestId = "open-in-new-tab-button"
61
+ ariaLabel = "Open in new tab"
62
+ icon = { < Icon name = "ic-arrow-square-out" color = { null } /> }
63
+ variant = { ButtonVariantType . borderLess }
64
+ style = { ButtonStyleType . neutral }
65
+ size = { ComponentSizeType . xs }
66
+ component = { ButtonComponentType . anchor }
67
+ anchorProps = { {
68
+ href : docLink ,
69
+ } }
70
+ />
71
+ </ SidePanelHeaderActions >
72
+ ) }
70
73
71
74
< div className = "flex-grow-1 dc__position-rel" >
72
75
< ProgressBar isLoading = { isLoading } />
0 commit comments