Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

show placeholder when timeline empty #670

Merged
merged 1 commit into from
Feb 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/structures/FilePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ var FilePanel = React.createClass({
showUrlPreview = { false }
tileShape="file_grid"
opacity={ this.props.opacity }
empty="There are no visible files in this room"
/>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/components/structures/NotificationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var NotificationPanel = React.createClass({
showUrlPreview = { false }
opacity={ this.props.opacity }
tileShape="notif"
empty="You have no visible notifications"
/>
);
}
Expand Down
11 changes: 11 additions & 0 deletions src/components/structures/TimelinePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ var TimelinePanel = React.createClass({

// shape property to be passed to EventTiles
tileShape: React.PropTypes.string,

// placeholder text to use if the timeline is empty
empty: React.PropTypes.string,
},

statics: {
Expand Down Expand Up @@ -990,6 +993,14 @@ var TimelinePanel = React.createClass({
);
}

if (this.state.events.length == 0) {
return (
<div className={ this.props.className + " mx_RoomView_messageListWrapper" }>
<div className="mx_RoomView_empty">{ this.props.empty }</div>
</div>
);
}

// give the messagepanel a stickybottom if we're at the end of the
// live timeline, so that the arrival of new events triggers a
// scroll.
Expand Down