I currently have a dashboard type app that pulls messages out of multiple slack channels and displays the ones without any replies or emojis. You can change which channel you want to view.
Currently, the parent state looks something like this:
state = {
selected_channel: window.localStorage.getItem( 'last-slack-ch' ) || 'ABC123'
selected_date: new Date(),
channels: {},
items: [],
slack_users: {},
settings: {
seconds_per_slack_messages_pull: 1
},
atBottom: false
}
After pulling in the messages... or items
, I pass that array into a component ItemsContainer
.
This is the render method in ItemsContainer
render() {
return (
<div className="items-container">
{
this.props.items.length > 0 ?
<ReactCSSTransitionGroup
transitionName='item'
transitionEnterTimeout={500}
transitionLeaveTimeout={500}>
{
this.props.items.map( t => {
return (
<Item
key={ t.usr + '_' + t.ts }
task={ t }
user={ this.props.slack_users[ t.usr ] }
settings={ this.props.settings }
/>
)
} )
}
</ReactCSSTransitionGroup>
:
<p className='nothing-found'>No items were found in channel: { this.props.selected_channel }</p>
}
</div>
);
}
The issue I am currently facing is that there are certain events that I don't want to have a transition. Stuff like: Initial page load and switching channels.
I tried passing in some props to ItemsContainer
which will determine what transitionName to the ReactCSSTransitionGroup
... but things didnt really work too well.
Anyone have experience with this?