react-trello icon indicating copy to clipboard operation
react-trello copied to clipboard

AddCardLink: refine onclick

Open jordanos opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. -When AddCardLink is supplied as a custom component there is no way to supply onclick callback function, lets say if I want to show modals when it is pressed. -If i just add onclick method on the custom component and dispatch some action using redux. the dispatch function of does'nt pick up my app store instead reac-trello's store.. so things get a little complex

Describe the solution you'd like A way to supply onclick callback function for AddCardLink.

jordanos avatar Apr 02 '22 13:04 jordanos

Hi @jordanos,

Do you know how to add link on title or somewhere else?

Best,

Marko

MarkoKurtovic avatar Apr 15 '22 06:04 MarkoKurtovic

Hey @MarkoKurtovic .

Can you elaborate the question? Where do you wanna add the link.. is it on card titles?

jordanos avatar Apr 15 '22 06:04 jordanos

Thanks for answering @jordanos

Yes, i just need simple redirect link on title.

Best,

Marko Kurtovic

MarkoKurtovic avatar Apr 15 '22 07:04 MarkoKurtovic

okay @MarkoKurtovic You can get that by creating a custom card component where you'll add a redirect link by wrapping the <CardTitle/>, Then supplying it as a prop like this:

const components = { Card: CustomCard, }; <Board components={components} />

You can create a custom card component using this format. I've done the same stuff when I needed to customize the card for my use here check it out it might help you.

jordanos avatar Apr 15 '22 09:04 jordanos