chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
42 lines (40 loc) • 1.34 kB
JavaScript
/**
* @component
*/
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
const VerificationIcon = _ref => {
let {
name,
design = VerificationIcon.BLUE_DESIGN,
verified = false
} = _ref;
if (!verified) {
return name || null;
}
const className = clsx(design === VerificationIcon.DEFAULT_DESIGN && 'vcid-check', design === VerificationIcon.GRAY_DESIGN && 'vcid-check--gray', design === VerificationIcon.BLUE_DESIGN && 'vcid-check--blue');
return /*#__PURE__*/React.createElement(React.Fragment, null, name, ' ', /*#__PURE__*/React.createElement("span", {
className: className
}, /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement("span", null)));
};
VerificationIcon.DEFAULT_DESIGN = 0;
VerificationIcon.GRAY_DESIGN = 1;
VerificationIcon.BLUE_DESIGN = 2;
VerificationIcon.propTypes = {
/**
* The username
*/
name: PropTypes.string.isRequired,
/**
* The design of the icon. Use either `VerificationIcon.DEFAULT_DESIGN`,
* `VerificationIcon.GRAY_DESIGN` or `VerificationIcon.BLUE_DESIGN`.
*/
design: PropTypes.number,
/**
* Whether the user is verified
*/
verified: PropTypes.bool
};
export default VerificationIcon;
//# sourceMappingURL=VerificationIcon.js.map