GetStream / stream-chat-react

React Chat SDK ➜ Stream Chat 💬
https://getstream.io/chat/sdk/react/
Other
698 stars 272 forks source link

Change default file upload icon and send message icon #2476

Closed GuysmoB closed 3 weeks ago

GuysmoB commented 3 weeks ago

Hi,

I would like to know if there is a way to change these icons without creating a new whole input message ? If no, adding a new props for <MessageInput/> to let the user choose his icons could be interesting.

Thank you !

arnautov-anton commented 3 weeks ago

Hey, @GuysmoB, you're probably looking for a FileUploadIcon prop on Channel component (passed to MessageInput through ComponentContext):

const CustomFileIcon = () => (
    <svg .../>
);

<Channel FileUploadIcon={CustomFileIcon} >...</Channel>

As for the send message icon - you'll have to replace a whole button, you can take an inspiration from our default button and replicate the behavior while changing the icon. You can replace it the same way you'd replace the file icon, through Channel's prop SendButton.

GuysmoB commented 3 weeks ago

Thank you @arnautov-anton