mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
fix: move outdated sdks check up (#6725)
This commit is contained in:
parent
ca6946df86
commit
c12cb42885
@ -23,6 +23,7 @@ import { EdgeUpgradeBanner } from './banners/EdgeUpgradeBanner/EdgeUpgradeBanner
|
|||||||
import { LicenseBanner } from './banners/internalBanners/LicenseBanner';
|
import { LicenseBanner } from './banners/internalBanners/LicenseBanner';
|
||||||
import { Demo } from './demo/Demo';
|
import { Demo } from './demo/Demo';
|
||||||
import { OutdatedSdksBanner } from './banners/OutdatedSdksBanner/OutdatedSdksBanner';
|
import { OutdatedSdksBanner } from './banners/OutdatedSdksBanner/OutdatedSdksBanner';
|
||||||
|
import { useUiFlag } from '../hooks/useUiFlag';
|
||||||
|
|
||||||
const StyledContainer = styled('div')(() => ({
|
const StyledContainer = styled('div')(() => ({
|
||||||
'& ul': {
|
'& ul': {
|
||||||
@ -49,6 +50,8 @@ export const App = () => {
|
|||||||
}
|
}
|
||||||
}, [authDetails, user]);
|
}, [authDetails, user]);
|
||||||
|
|
||||||
|
const outdatedSdksBannerEnabled = useUiFlag('outdatedSdksBanner');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SWRProvider>
|
<SWRProvider>
|
||||||
<Suspense fallback={<Loader />}>
|
<Suspense fallback={<Loader />}>
|
||||||
@ -68,6 +71,10 @@ export const App = () => {
|
|||||||
<ExternalBanners />
|
<ExternalBanners />
|
||||||
<InternalBanners />
|
<InternalBanners />
|
||||||
<EdgeUpgradeBanner />
|
<EdgeUpgradeBanner />
|
||||||
|
<ConditionallyRender
|
||||||
|
condition={outdatedSdksBannerEnabled}
|
||||||
|
show={<OutdatedSdksBanner />}
|
||||||
|
/>
|
||||||
<OutdatedSdksBanner />
|
<OutdatedSdksBanner />
|
||||||
<StyledContainer>
|
<StyledContainer>
|
||||||
<ToastRenderer />
|
<ToastRenderer />
|
||||||
|
@ -2,7 +2,6 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
|
|||||||
import { Banner } from '../Banner/Banner';
|
import { Banner } from '../Banner/Banner';
|
||||||
import type { IBanner } from 'interfaces/banner';
|
import type { IBanner } from 'interfaces/banner';
|
||||||
import { useOutdatedSdks } from 'hooks/api/getters/useOutdatedSdks/useOutdatedSdks';
|
import { useOutdatedSdks } from 'hooks/api/getters/useOutdatedSdks/useOutdatedSdks';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { styled } from '@mui/material';
|
import { styled } from '@mui/material';
|
||||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||||
@ -13,7 +12,6 @@ export const OutdatedSdksBanner = () => {
|
|||||||
const {
|
const {
|
||||||
data: { sdks },
|
data: { sdks },
|
||||||
} = useOutdatedSdks();
|
} = useOutdatedSdks();
|
||||||
const flagEnabled = useUiFlag('outdatedSdksBanner');
|
|
||||||
const { trackEvent } = usePlausibleTracker();
|
const { trackEvent } = usePlausibleTracker();
|
||||||
|
|
||||||
const applicationClickedWithVersion = (sdkVersion: string) => {
|
const applicationClickedWithVersion = (sdkVersion: string) => {
|
||||||
@ -74,7 +72,7 @@ export const OutdatedSdksBanner = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ConditionallyRender
|
<ConditionallyRender
|
||||||
condition={flagEnabled && sdks.length > 0}
|
condition={sdks.length > 0}
|
||||||
show={<Banner banner={outdatedSdksBanner} />}
|
show={<Banner banner={outdatedSdksBanner} />}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user