Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BannerUpsell: VR #3922

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
21 changes: 20 additions & 1 deletion packages/gestalt/src/BannerUpsell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Children, ComponentProps, ReactElement, ReactNode } from 'react';
import classnames from 'classnames';
import styles from './BannerUpsell.css';
import VRBannerUpsell from './BannerUpsell/VRBannerUpsell';
import BannerUpsellForm from './BannerUpsellForm';
import Box from './Box';
import Button from './Button';
Expand All @@ -11,6 +12,7 @@ import IconButton from './IconButton';
import Image from './Image';
import Mask from './Mask';
import Text from './Text';
import useInExperiment from './useInExperiment';
import useResponsiveMinWidth from './useResponsiveMinWidth';

export type ActionDataType =
Expand Down Expand Up @@ -148,7 +150,10 @@ export default function BannerUpsell({
const hasActions = Boolean(primaryAction || secondaryAction);
const { colorSchemeName } = useColorScheme();
const isDarkMode = colorSchemeName === 'darkMode';

const isInVRExperiment = useInExperiment({
webExperimentName: 'web_gestalt_visualRefresh',
mwebExperimentName: 'web_gestalt_visualRefresh',
});
let messageElement: ReactNode;

if (typeof message === 'string') {
Expand Down Expand Up @@ -177,6 +182,20 @@ export default function BannerUpsell({
</span>
);
}
if (isInVRExperiment) {
return (
<VRBannerUpsell
dismissButton={dismissButton}
imageData={imageData}
message={message}
primaryAction={primaryAction}
secondaryAction={secondaryAction}
title={title}
>
{children}
</VRBannerUpsell>
);
}

return (
<Box
Expand Down
Loading
Loading