react-images-lightbox
Version:
A simple, responsive lightbox component for displaying an array of images with React.js
25 lines (20 loc) • 418 B
JavaScript
import PropTypes from 'prop-types';
import React from 'react';
import icons from '../icons';
const Icon = ({ fill, type, ...props }) => {
const icon = icons[type];
return (
<span
dangerouslySetInnerHTML={{ __html: icon(fill) }}
{...props}
/>
);
};
Icon.propTypes = {
fill: PropTypes.string,
type: PropTypes.oneOf(Object.keys(icons)),
};
Icon.defaultProps = {
fill: 'white',
};
export default Icon;