ComposeForm: convert buttons to ComposeFormButton component

This commit is contained in:
Alex Gleason 2022-03-21 17:04:44 -05:00
parent c9a4087108
commit 890299ead0
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
6 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,34 @@
import classNames from 'classnames';
import React from 'react';
import { IconButton } from 'soapbox/components/ui';
interface IComposeFormButton {
icon: string,
title?: string,
active?: boolean,
disabled?: boolean,
onClick: () => void,
}
const ComposeFormButton: React.FC<IComposeFormButton> = ({
icon,
title,
active,
disabled,
onClick,
}) => {
return (
<div>
<IconButton
className={classNames('text-gray-400 hover:text-gray-600', { 'text-gray-600': active })}
src={icon}
title={title}
disabled={disabled}
onClick={onClick}
/>
</div>
);
};
export default ComposeFormButton;