File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
packages/manager/apps/pci-block-storage/src Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ import { usePCIFeatureAvailability } from '@ovh-ux/manager-pci-common' ;
2+
3+ export const FILE_STORAGE_ALPHA = 'pci-block-storage:file-storage-alpha-banner' ;
4+
5+ export const useIsFileStorageAlphaBannerAvailable = ( ) => {
6+ const { data } = usePCIFeatureAvailability ( [ FILE_STORAGE_ALPHA ] ) ;
7+
8+ return data ?. get ( FILE_STORAGE_ALPHA ) ?? false ;
9+ } ;
Original file line number Diff line number Diff line change @@ -3,13 +3,17 @@ import { useTranslation } from 'react-i18next';
33import { useGeneralBannerContext } from '@/contexts/GeneralBanner.context' ;
44import { Banner } from '@/components/banner/Banner.component' ;
55import { ButtonLink } from '@/components/button-link/ButtonLink' ;
6+ import { useIsFileStorageAlphaBannerAvailable } from '@/api/feature' ;
67
78export const FileStorageAlphaBanner = ( ) => {
89 const { t } = useTranslation ( [ 'general-banners' ] ) ;
910
1011 const { addBanner, getBanner } = useGeneralBannerContext ( ) ;
12+ const isFileStorageAlphaBannerAvailable = useIsFileStorageAlphaBannerAvailable ( ) ;
1113
1214 useEffect ( ( ) => {
15+ if ( ! isFileStorageAlphaBannerAvailable ) return ;
16+
1317 addBanner ( 'alpha_file_storage' , ( { onRemove } ) => (
1418 < Banner
1519 iconName = "circle-info"
@@ -34,7 +38,7 @@ export const FileStorageAlphaBanner = () => {
3438 </ div >
3539 </ Banner >
3640 ) ) ;
37- } , [ ] ) ;
41+ } , [ isFileStorageAlphaBannerAvailable ] ) ;
3842
3943 return getBanner ( 'alpha_file_storage' ) ;
4044} ;
You can’t perform that action at this time.
0 commit comments