talkjs / talkjs-examples

TalkJS (https://talkjs.com) examples
118 stars 119 forks source link

Button Actions #545

Closed prachipatel01 closed 3 months ago

prachipatel01 commented 3 months ago

Hey, I am building a chat application using talkjs react-native sdk. The react-native SKD is really awesome. The only issue I am facing is to add custom actions on custom button in the UI. I went through the whole documentation but couldn't find a way to add custom actions.

Can you please help me with how to do that? I really appreciate any help you can provide.

vickz84259 commented 3 months ago

Hey, my name is Victor. I'm a developer here at TalkJS. To add custom actions you do that through the Theme Editor on the TalkJS dashboard. You can read more about them here: https://talkjs.com/docs/Features/Customizations/Action_Buttons_Links/

vickz84259 commented 3 months ago

Once you've modified your theme to your liking, you can add that theme to a specific role then assign that role to a user or you can even override the theme directly through the theme prop on either the Chatbox or ConversationList components.

prachipatel01 commented 3 months ago

Hey Victor, thanks for your prompt response.

I tried your approach but my use case is different. I want an action to occur when the user clicks on a specific UI component (not necessarily a button). For example, I have a custom message component that contains an image, now when the user clicks on this image I want certain actions(for example, navigating to a different screen) to be performed.

prachipatel01 commented 3 months ago

Hey, Thanks to talkjs support team, I got a solution for my use case. I can wrap the image around ActionLink and trigger any action I want.