* init * buttons * buttons, ctas, icons * ctas fix * links vs ctas * alias * fixes * add tests for Buttons component * add tooltip to button story controls * add link and CTA tests * add prop types * docs * designs * docs * focus visible moved to global place * Updated some component snapshot tests. * Mocked react-inlinesvg module because of https://github.com/gilbarbara/react-inlinesvg/issues/145\#issuecomment-623453339 * tests * Copy updates Co-authored-by: Suzanne Aitchison <suzanne@forem.com> * missed spots * Apply suggestions from code review Co-authored-by: Suzanne Aitchison <suzanne@forem.com> * danger accent colors * node * colors * adding code comment * better prop name: style -> variant * button new Co-authored-by: Suzanne Aitchison <suzanne@forem.com> Co-authored-by: Nick Taylor <nick@dev.to>
22 lines
546 B
JavaScript
22 lines
546 B
JavaScript
import { h } from 'preact';
|
|
import PropTypes from 'prop-types';
|
|
import classNames from 'classnames/bind';
|
|
import { Link } from '@crayons';
|
|
|
|
export const CTA = (props) => {
|
|
const { variant = 'default', className, ...otherProps } = props;
|
|
|
|
const classes = classNames('c-cta', {
|
|
[`c-cta--${variant}`]: variant,
|
|
[className]: className,
|
|
});
|
|
|
|
return <Link block className={classes} {...otherProps} />;
|
|
};
|
|
|
|
CTA.displayName = 'CTA';
|
|
|
|
CTA.propTypes = {
|
|
variant: PropTypes.oneOf(['default', 'branded']),
|
|
className: PropTypes.string,
|
|
};
|