1- import React , { FC , useContext , useMemo } from 'react'
1+ import React , { FC , useContext } from 'react'
22
33// Components
44import {
@@ -14,6 +14,9 @@ import SelectorTitle from 'src/dataExplorer/components/SelectorTitle'
1414import { FluxQueryBuilderContext } from 'src/dataExplorer/context/fluxQueryBuilder'
1515import { PersistanceContext } from 'src/dataExplorer/context/persistance'
1616
17+ // Utils
18+ import { isFlagEnabled } from 'src/shared/utils/featureFlag'
19+
1720const FLUX_SYNC_DISABLE_TEXT = `Schema Sync is no longer available because the \
1821code block has been edited.`
1922
@@ -43,38 +46,39 @@ const SchemaBrowserHeading: FC = () => {
4346 </ div >
4447 )
4548
46- return useMemo (
47- ( ) => (
48- < FlexBox
49- className = "schema-browser-heading"
50- justifyContent = { JustifyContent . SpaceBetween }
51- >
52- < div className = "schema-browser-heading--text" > Schema Browser</ div >
53- < FlexBox className = "flux-sync" >
54- < SlideToggle
55- className = "flux-sync--toggle"
56- active = { fluxSync }
57- onChange = { handleFluxSyncToggle }
58- testID = "flux-sync--toggle"
59- disabled = { disableToggle }
60- tooltipText = { disableTooltipText }
61- />
62- < InputLabel className = "flux-sync--label" >
63- < div
64- className = { `${ disableToggle ? 'disabled' : '' } ` }
65- title = { disableTooltipText }
66- >
67- < SelectorTitle
68- label = "Flux Sync"
69- tooltipContents = { tooltipContents }
70- icon = { IconFont . Sync }
71- />
72- </ div >
73- </ InputLabel >
74- </ FlexBox >
49+ if ( ! isFlagEnabled ( 'schemaComposition' ) ) {
50+ return null
51+ }
52+
53+ return (
54+ < FlexBox
55+ className = "schema-browser-heading"
56+ justifyContent = { JustifyContent . SpaceBetween }
57+ >
58+ < div className = "schema-browser-heading--text" > Schema Browser</ div >
59+ < FlexBox className = "flux-sync" >
60+ < SlideToggle
61+ className = "flux-sync--toggle"
62+ active = { fluxSync }
63+ onChange = { handleFluxSyncToggle }
64+ testID = "flux-sync--toggle"
65+ disabled = { disableToggle }
66+ tooltipText = { disableTooltipText }
67+ />
68+ < InputLabel className = "flux-sync--label" >
69+ < div
70+ className = { `${ disableToggle ? 'disabled' : '' } ` }
71+ title = { disableTooltipText }
72+ >
73+ < SelectorTitle
74+ label = "Flux Sync"
75+ tooltipContents = { tooltipContents }
76+ icon = { IconFont . Sync }
77+ />
78+ </ div >
79+ </ InputLabel >
7580 </ FlexBox >
76- ) ,
77- [ fluxSync , toggleFluxSync ]
81+ </ FlexBox >
7882 )
7983}
8084
0 commit comments