Sha256: af9b6523bd28c135fdb1c1dfe94ea7885246acdc20ab9d0f5d9111508eee548b
Contents?: true
Size: 1.39 KB
Versions: 50
Compression:
Stored size: 1.39 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { Avatar, Icon } from '../' import { buildAriaProps, buildCss, buildDataProps, } from '../utilities/props' type AvatarActionButtonProps = { action?: String, aria: Object, className?: String, data?: Object, id?: String, imageUrl?: String, linkUrl?: String, name?: String, onClick?: String, placement?: String, size?: String, } const AvatarActionButton = ({ action = 'add', aria = {}, className, data = {}, id, imageUrl, linkUrl, name, onClick, placement = 'bottom left', size = 'md', }: AvatarActionButtonProps) => { const ariaProps = buildAriaProps(aria) const dataProps = buildDataProps(data) const css = buildCss({ 'pb_avatar_action_button_kit': true, [action]: true, [placement]: true, [size]: true, }) const icons = { add: 'plus-circle', remove: 'times-circle', } return ( <div {...ariaProps} {...dataProps} className={classnames(css, className)} id={id} > <a href={linkUrl} onClick={onClick} > <Avatar imageUrl={imageUrl} name={name} size={size} /> <div className="icon"> <Icon icon={icons[action]} /> </div> </a> </div> ) } export default AvatarActionButton
Version data entries
50 entries across 50 versions & 1 rubygems