MCPcopy Create free account
hub / github.com/bytebase/bytebase / BannersWrapper

Function BannersWrapper

frontend/src/react/components/BannersWrapper.tsx:312–332  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

310}
311
312export function BannersWrapper() {
313 const { needConfigureExternalUrl } = useServerState();
314 const { currentPlan, daysBeforeExpire, isExpired, isTrialing } =
315 useSubscriptionState();
316
317 const shouldShowSubscriptionBanner =
318 isExpired ||
319 isTrialing ||
320 (currentPlan !== PlanType.FREE &&
321 daysBeforeExpire <= LICENSE_EXPIRATION_THRESHOLD);
322 const shouldShowExternalUrlBanner = !isDev() && needConfigureExternalUrl;
323
324 return (
325 <>
326 <BannerUpgradeSubscription />
327 {shouldShowSubscriptionBanner ? <BannerSubscription /> : null}
328 {shouldShowExternalUrlBanner ? <BannerExternalUrl /> : null}
329 <BannerAnnouncement />
330 </>
331 );
332}

Callers

nothing calls this directly

Calls 3

useServerStateFunction · 0.90
useSubscriptionStateFunction · 0.90
isDevFunction · 0.90

Tested by

no test coverage detected