@shopgate/engage
Version:
Shopgate's ENGAGE library.
39 lines (38 loc) • 1.1 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import appConfig from '@shopgate/pwa-common/helpers/config';
import noop from 'lodash/noop';
import styles from "./style";
import connect from "./connector";
/**
* The Logo component.
* @return {JSX}
*/
import { jsx as _jsx } from "react/jsx-runtime";
const Logo = ({
className,
onClick,
showLogo
}) => {
if (!showLogo) {
return null;
}
return /*#__PURE__*/ /* eslint-disable jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions */_jsx("div", {
onClick: onClick,
className: classNames(styles.container, className, 'engage__logo'),
children: /*#__PURE__*/_jsx("img", {
className: styles.image,
src: appConfig.logo || appConfig.logoFallback,
alt: appConfig.shopName
})
})
/* eslint-enable jsx-a11y/no-static-element-interactions */
/* eslint-enable jsx-a11y/click-events-have-key-events */;
};
Logo.defaultProps = {
className: '',
onClick: noop,
showLogo: true
};
export default connect(Logo);