chore: Callout to Banner component migration for Billing Banner (#27910)
This commit is contained in:
parent
e040d261ac
commit
9ae7257ece
|
|
@ -49,5 +49,8 @@ export const getIsFormLoginEnabled = (state: AppState): boolean =>
|
|||
export const getInstanceId = (state: AppState): string =>
|
||||
state.tenant?.instanceId;
|
||||
|
||||
// eslint-disable-next-line
|
||||
export const shouldShowLicenseBanner = (state: AppState) => false;
|
||||
|
||||
export const getHideWatermark = (state: AppState): boolean =>
|
||||
state.tenant?.tenantConfiguration?.hideWatermark;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState, useMemo, useEffect } from "react";
|
||||
import { Link, useLocation } from "react-router-dom";
|
||||
import { Link, useLocation, useRouteMatch } from "react-router-dom";
|
||||
import { connect, useDispatch, useSelector } from "react-redux";
|
||||
import { getCurrentUser } from "selectors/usersSelectors";
|
||||
import styled from "styled-components";
|
||||
|
|
@ -22,7 +22,10 @@ import ProfileDropdown from "./ProfileDropdown";
|
|||
import { useIsMobileDevice } from "utils/hooks/useDeviceDetect";
|
||||
import MobileSideBar from "./MobileSidebar";
|
||||
import { getTemplateNotificationSeenAction } from "actions/templateActions";
|
||||
import { getTenantConfig } from "@appsmith/selectors/tenantSelectors";
|
||||
import {
|
||||
getTenantConfig,
|
||||
shouldShowLicenseBanner,
|
||||
} from "@appsmith/selectors/tenantSelectors";
|
||||
import AnalyticsUtil from "utils/AnalyticsUtil";
|
||||
import { Button } from "design-system";
|
||||
import { getSelectedAppTheme } from "selectors/appThemingSelectors";
|
||||
|
|
@ -30,12 +33,14 @@ import { getCurrentApplication } from "selectors/editorSelectors";
|
|||
import { get } from "lodash";
|
||||
import { NAVIGATION_SETTINGS } from "constants/AppConstants";
|
||||
import { getAssetUrl, isAirgapped } from "@appsmith/utils/airgapHelpers";
|
||||
import { Banner } from "@appsmith/utils/licenseHelpers";
|
||||
|
||||
const StyledPageHeader = styled(StyledHeader)<{
|
||||
hideShadow?: boolean;
|
||||
isMobile?: boolean;
|
||||
showSeparator?: boolean;
|
||||
showingTabs: boolean;
|
||||
isBannerVisible?: boolean;
|
||||
}>`
|
||||
justify-content: normal;
|
||||
background: var(--ads-v2-color-bg);
|
||||
|
|
@ -51,6 +56,7 @@ const StyledPageHeader = styled(StyledHeader)<{
|
|||
padding: 0 12px;
|
||||
padding-left: 10px;
|
||||
`};
|
||||
${({ isBannerVisible }) => isBannerVisible && `top: 40px;`};
|
||||
`;
|
||||
|
||||
const HeaderSection = styled.div`
|
||||
|
|
@ -188,11 +194,17 @@ export function PageHeader(props: PageHeaderProps) {
|
|||
}, [location.pathname]);
|
||||
|
||||
const isAirgappedInstance = isAirgapped();
|
||||
const showBanner = useSelector(shouldShowLicenseBanner);
|
||||
const isHomePage = useRouteMatch("/applications")?.isExact;
|
||||
const isLicensePage = useRouteMatch("/license")?.isExact;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Banner />
|
||||
<StyledPageHeader
|
||||
data-testid="t--appsmith-page-header"
|
||||
hideShadow={props.hideShadow || false}
|
||||
isBannerVisible={showBanner && (isHomePage || isLicensePage)}
|
||||
isMobile={isMobile}
|
||||
showSeparator={props.showSeparator || false}
|
||||
showingTabs={showTabs}
|
||||
|
|
@ -286,6 +298,7 @@ export function PageHeader(props: PageHeaderProps) {
|
|||
/>
|
||||
)}
|
||||
</StyledPageHeader>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import type { ReactNode } from "react";
|
|||
import React, { useMemo } from "react";
|
||||
import { Helmet } from "react-helmet";
|
||||
import styled from "styled-components";
|
||||
import { Banner } from "@appsmith/utils/licenseHelpers";
|
||||
import {
|
||||
getPageTitle,
|
||||
getHTMLPageTitle,
|
||||
|
|
@ -84,7 +83,6 @@ export function PageWrapper(props: PageWrapperProps) {
|
|||
|
||||
return (
|
||||
<Wrapper isFixed={isFixed}>
|
||||
<Banner />
|
||||
<Helmet>
|
||||
<title>{pageTitle}</title>
|
||||
</Helmet>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user