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

pass props to LaneHeader and Card components

Open andrei10k opened this issue 4 years ago • 3 comments

Hello

With the old way of adding a LaneHeader i could easily add custom props. How can i add props with the new way with the components object?

for example:

render() {
    const { data, children, customLaneHeader, onDragEnd, onLaneScroll } = this.props
    const components = {
      ...(customLaneHeader ? { LaneHeader: customLaneHeader } : {}),
      ...(children ? { Card: children } : {})
    }
    return (
      <Board
        data={data}
        draggable
        laneDraggable={false}
        handleDragEnd={(cardId, sourceLaneId, targetLaneId, position, cardDetails) => {
          if (sourceLaneId === targetLaneId) return false
          onDragEnd && onDragEnd(targetLaneId, cardDetails)
        }}
        onLaneScroll={onLaneScroll}
        components={components}
      />
    )
  }

and in another file i have:

customLaneHeader={
                <LaneHeader
                  toggleSelectAllDeals={this.toggleSelectAllDeals}
                  addBoardColumnRef={this.addBoardColumnRef}
                  dataType='deal'
                  hasActions
                  boardHeaders={this.props.boardHeaders}
                  updateDealsStatusFollowupDate={this.updateDealsStatusFollowupDate}
                />
              }

Thanks

andrei10k avatar Feb 23 '21 23:02 andrei10k

@rcdexta any info please?

andrei10k avatar Jul 21 '21 08:07 andrei10k

@rcdexta Is there a way to get rid off this tooltip from the card styling or from both Lane and card? image

garimahans15 avatar Nov 11 '21 09:11 garimahans15

@garimahans15 what does your question got in common with this open issue? can you please remove it from here and create a new, relevant one?

andrei10k avatar Nov 11 '21 13:11 andrei10k