How to use the @shopgate/engage/core.isBeta function in @shopgate/engage

To help you get started, we’ve selected a few @shopgate/engage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shopgate / pwa / libraries / engage / product / components / EffectivityDates / helpers.js View on Github external
export const buildShowScheduledParams = () => {
  if (!isBeta()) {
    return {};
  }

  let cachedTime = null;
  let { effectivityDates: { showScheduled } = {} } = getThemeSettings('product') || {};

  if (showScheduled === ALWAYS) {
    showScheduled = 'P1Y';
  } else if (showScheduled === NEVER) {
    showScheduled = 'PT0S';
    cachedTime = 60000; // 1 minute min effective precision
  }

  return {
    cachedTime,
    params: {
github shopgate / pwa / themes / theme-gmd / pages / Product / components / Header / components / CTAButtons / index.jsx View on Github external
{/* This feature is currently in BETA testing.
          It should only be used for approved BETA Client Projects */}
          {isBeta() &&  }
        
        
      
    
    
  
);
github shopgate / pwa / themes / theme-ios11 / pages / Product / components / Characteristics / index.jsx View on Github external
renderer = (props) => {
    if (isBeta() && !!props.swatch) {
      return ;
    }
    return ;
  };
github shopgate / pwa / libraries / engage / product / components / EffectivityDates / index.jsx View on Github external
const EffectivityDates = ({ dates, children, productNotAvailable }) => {
  if (!isBeta() || !dates) {
    return children;
  }

  const settings = useWidgetSettings('@shopgate/engage/product/EffectivityDates');

  const startDate = new Date(dates.startDate);
  const endDate = new Date(dates.endDate);

  return (
    
      {({ before, between, after }) => {
        if (before) {
          return showStartDateHint(settings, startDate)
            ? 
            : children;
        }
github shopgate / pwa / themes / theme-ios11 / themeApi / ProductCard / components / Render / index.jsx View on Github external
hideRating,
  titleRows,
}) {
  const {
    featuredImageUrl,
    featuredMedia,
    id,
    name,
    price,
    rating,
  } = product;

  return (
    

      {isBeta() && featuredMedia
        ? 
        : 
      }

      {(!hidePrice && price.discount > 0) && }

      {(!(hidePrice && hideRating)) && (
        <div>
          {(!hideRating &amp;&amp; rating &amp;&amp; rating.average &gt; 0) &amp;&amp; (
            
          )}
          {!hideName &amp;&amp; (</div>
github shopgate / pwa / libraries / engage / product / components / ProductCard / index.jsx View on Github external
function ProductCard(props) {
  const {
    product, hidePrice, hideRating, hideName, titleRows,
  } = props;

  return (
    
      {isBeta() &amp;&amp; product.featuredMedia
        ? 
        : 
      }
      {!!(!hidePrice &amp;&amp; product.price.discount) &amp;&amp; (
        <div>
          
          
            
          
          
        </div>
      )}
github shopgate / pwa / libraries / engage / product / components / OrderQuantityHint / index.jsx View on Github external
const OrderQuantityHint = ({ stock }) =&gt; {
  if (!isBeta()) {
    return null;
  }

  const settings = useWidgetSettings('@shopgate/engage/product/OrderQuantityHint');

  return (
    
      {settings.show &amp;&amp; stock &amp;&amp; !!stock.minOrderQuantity &amp;&amp;
        <div>
          
        </div>
        }
      {settings.show &amp;&amp; stock &amp;&amp; !!stock.maxOrderQuantity &amp;&amp;
github shopgate / pwa / themes / theme-gmd / components / ProductGrid / components / Item / index.jsx View on Github external
const Item = ({ product, display }) =&gt; (
  
    {isBeta() &amp;&amp; product.featuredMedia
      ? 
      : 
    }
github shopgate / pwa / libraries / engage / product / helpers / redirects.js View on Github external
export const enableRedirectHandler = () => {
  if (!isBeta()) {
    return;
  }

  /** Effectivity dates */
  const { effectivityDates: { accessExpired } = {} } = getThemeSettings('product') || {};
  if (accessExpired) {
    return;
  }

  const getProductEffectivityDates = makeGetProductEffectivityDates();

  redirects.set(ITEM_PATTERN, ({ action, getState }) => {
    const { params: { pathname }, route: { state: { productId } } } = action;

    const effectivityDates = getProductEffectivityDates(getState(), { productId });
    if (effectivityDates) {
github shopgate / pwa / libraries / engage / product / helpers / index.js View on Github external
export const setDefaultProductFetchParams = () => {
  if (!isBeta()) {
    return;
  }
  configuration.set(DEFAULT_PRODUCTS_FETCH_PARAMS, {
    characteristics: true,
  });
};