UNPKG

vcc-ui

Version:

A React library for building user interfaces at Volvo Cars

36 lines 1.07 kB
import _extends from "@babel/runtime/helpers/extends"; import PropTypes from 'prop-types'; import React from 'react'; import { useTheme } from '../../styling/use-theme'; import { Block } from '../block'; /** @deprecated Use `Wordmark` from `@volvo-cars/react-icons` instead. */ export const Logo = /*#__PURE__*/React.forwardRef(function Logo(_ref, ref) { let { type, height, alt = 'Volvo', ...props } = _ref; const theme = useTheme(); const logoFileName = theme.name.includes('dark') ? 'volvo-wordmark.svg' : 'volvo-wordmark-black.svg'; const src = `${theme.logoImagesPath}${logoFileName}`; return /*#__PURE__*/React.createElement(Block, _extends({}, props, { ref: ref, alt: alt, as: "img", src: src, height: height, extend: { verticalAlign: 'middle', maxHeight: '100%', maxWidth: '100%' } })); }); Logo.propTypes = { type: PropTypes.oneOf(['spreadmark']), /** Height of the logo image */ height: PropTypes.number, /** Alternative text for the logo image */ alt: PropTypes.string };