className: PropTypes.string,
style: PropTypes.object,
children: PropTypes.node,
+ title: PropTypes.string,
};
static defaultProps = {
}
render () {
- const style = {
- padding: `0 ${this.props.size / 2.25}px`,
- height: `${this.props.size}px`,
- lineHeight: `${this.props.size}px`,
- ...this.props.style,
+ let attrs = {
+ className: classNames('button', this.props.className, {
+ 'button-secondary': this.props.secondary,
+ 'button--block': this.props.block,
+ }),
+ disabled: this.props.disabled,
+ onClick: this.handleClick,
+ ref: this.setRef,
+ style: {
+ padding: `0 ${this.props.size / 2.25}px`,
+ height: `${this.props.size}px`,
+ lineHeight: `${this.props.size}px`,
+ ...this.props.style,
+ },
};
- const className = classNames('button', this.props.className, {
- 'button-secondary': this.props.secondary,
- 'button--block': this.props.block,
- });
+ if (this.props.title) attrs.title = this.props.title;
return (
- <button
- className={className}
- disabled={this.props.disabled}
- onClick={this.handleClick}
- ref={this.setRef}
- style={style}
- >
+ <button {...attrs}>
{this.props.text || this.props.children}
</button>
);
let publishText = '';
let publishText2 = '';
+ let title = '';
+ let title2 = '';
const privacyIcons = {
none: '',
direct: 'envelope',
};
+ title = `${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${this.props.privacy}.short` })}`;
+
if (showSideArm) {
+ // Enhanced behavior with dual toot buttons
publishText = (
<span>
{
</span>
);
+ title2 = `${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${secondaryVisibility}.short` })}`;
publishText2 = (
<i
className={`fa fa-${privacyIcons[secondaryVisibility]}`}
- aria-label={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${secondaryVisibility}.short` })}`}
+ aria-label={title2}
/>
);
} else {
+ // Original vanilla behavior - no icon if public or unlisted
if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
publishText = <span className='compose-form__publish-private'><i className='fa fa-lock' /> {intl.formatMessage(messages.publish)}</span>;
} else {
<Button
className='compose-form__publish__side-arm'
text={publishText2}
+ title={title2}
onClick={this.handleSubmit2}
disabled={submitDisabled}
/> : ''
<Button
className='compose-form__publish__primary'
text={publishText}
+ title={title}
onClick={this.handleSubmit}
disabled={submitDisabled}
/>