* init * whoops * components update * components update * classes * variables * focus * test * spec * test * adjust colors and variables * buttons colors * Update app/javascript/crayons/CTAs/CTA.jsx Co-authored-by: Suzanne Aitchison <suzanne@forem.com> * proptype * remove duplicated tests now in Cypress, enhance Cypress nav menu tests * premove unneeded viewport in test * remove focus check for now * classnames * Update app/javascript/crayons/CTAs/__stories__/CTAs.mdx Co-authored-by: Nick Taylor <nick@iamdeveloper.com> * Update app/javascript/crayons/CTAs/__stories__/CTAs.mdx Co-authored-by: Nick Taylor <nick@iamdeveloper.com> * better contrast * classname * radius-full Co-authored-by: Suzanne Aitchison <suzanne@forem.com> Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
28 lines
542 B
JavaScript
28 lines
542 B
JavaScript
import { h } from 'preact';
|
|
import PropTypes from 'prop-types';
|
|
import classNames from 'classnames/bind';
|
|
|
|
export const Icon = ({
|
|
src: InternalIcon,
|
|
native,
|
|
className,
|
|
...otherProps
|
|
}) => {
|
|
return (
|
|
<InternalIcon
|
|
className={classNames('crayons-icon', {
|
|
'crayons-icon--default': native,
|
|
[className]: className,
|
|
})}
|
|
{...otherProps}
|
|
/>
|
|
);
|
|
};
|
|
|
|
Icon.displayName = 'Icon';
|
|
|
|
Icon.propTypes = {
|
|
native: PropTypes.bool,
|
|
className: PropTypes.string,
|
|
src: PropTypes.elementType.isRequired,
|
|
};
|