How to use the @shopgate/pwa-common/helpers/data.bin2hex function in @shopgate/pwa-common

To help you get started, we’ve selected a few @shopgate/pwa-common 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 / themes / theme-gmd / components / Reviews / components / Header / components / AverageRating / index.jsx View on Github external
const AverageRating = ({ average, count, productId }) => {
  if (!productId) {
    return null;
  }

  return (
    
      
      
    
  );
};
github shopgate / pwa / themes / theme-gmd / components / ProductList / components / Item / index.jsx View on Github external
const Item = ({ display, product }) => (
  
    
      

        {/* IMAGE */}
        
        
          <img alt="{product.name}" src="{product.featuredImageUrl}">
        
        

        {/* DISCOUNT */}
github shopgate / pwa / themes / theme-ios11 / themeApi / ProductCard / index.spec.jsx View on Github external
it('should render as expected', () => {
    const wrapper = renderComponent({ productId: mockProductId });
    expect(wrapper).toMatchSnapshot();

    const renderWrapper = wrapper.find('ProductCardRender');
    expect(renderWrapper.prop('url')).toBe(`${ITEM_PATH}/${bin2hex(mockProductId)}`);
    expect(renderWrapper.prop('product')).toBe(mockProduct);
  });
github shopgate / pwa / themes / theme-ios11 / themeApi / ProductCard / index.jsx View on Github external
function ProductCard({
  product,
  render,
  shadow,
  style,
}) {
  if (!product) {
    return null;
  }

  const cardStyle = {
    ...style,
    ...shadow &amp;&amp; shadowStyle,
  };
  const url = `${ITEM_PATH}/${bin2hex(product.id)}`;

  return (
    <section data-test-id="{`Product:" style="{cardStyle}">
      {render({
        product,
        url,
      })}
    </section>
  );
}
github shopgate / pwa / themes / theme-gmd / components / ProductCard / index.jsx View on Github external
const ProductCard = ({
  product, hidePrice, hideRating, hideName, titleRows,
}) =&gt; (
  
    
    {!!(!hidePrice &amp;&amp; product.price.discount) &amp;&amp; (
      <div>
        
        
          
        
        
      </div>
    )}
    {!(hidePrice &amp;&amp; hideRating) &amp;&amp; (
      <div></div>
github shopgate / pwa / libraries / commerce / product / streams / index.spec.js View on Github external
const wrappedRouteDidUpdate = (pattern, historyAction, productId = '', variantId = '') => routeDidUpdate({
  pattern,
  params: {
    productId: mockBin2Hex(productId),
  },
  state: {
    productId: variantId,
  },
}, historyAction);
github shopgate / pwa / libraries / engage / product / components / MediaSlider / connector.js View on Github external
navigate: currentSlide =>
    dispatch(historyPush({
      pathname: `${ITEM_PATH}/${bin2hex(props.productId)}/gallery/${currentSlide}`,
    })),
});
github shopgate / pwa / themes / theme-ios11 / widgets / NestedCategoryFilter / index.spec.jsx View on Github external
const checkWrapper = (wrapper, expectedProps, buttonCategoryId = null) => {
  const pickers = wrapper.find('Connect(CategoryPicker)');
  pickers.forEach((picker, index) => {
    expect(picker.props()).toEqual({
      ...expectedProps[index],
      label: settings[`label_${index + 1}`],
      onSelect: expect.any(Function),
    });
  });

  const button = wrapper.find('Connect(ButtonLink)');
  expect(button.prop('href')).toBe(`${CATEGORY_PATH}/${bin2hex(buttonCategoryId)}`);
  expect(button.prop('disabled')).toBe(!buttonCategoryId);
  expect(button.text()).toBe('common.show_products');
};