Skip to content

Commit

Permalink
Make SmsDistributionPane title show state
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanfisk committed Apr 14, 2019
1 parent 0d9701a commit 1a42735
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions locale/panes/smsDistribution/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ stats:
num_delivered_messages: '{ num_delivered_messages } Delivered'
targets: Targets
target_matches_have_changed: The target query's matches have changed since confirming
title:
draft: '{ title }'
confirm: 'Confirm "{ title }"'
sending: 'Sending "{ title }"'
sent: 'Sent "{ title }"'
11 changes: 7 additions & 4 deletions src/components/panes/SmsDistributionPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ export default class SmsDistributionPane extends PaneBase {
};
}

getPaneTitle(data) {
const { distributionItem } = this.props;
getPaneTitle({ isLoaded, title, state }) {
const formatMessage = this.props.intl.formatMessage;

if (!distributionItem || !distributionItem.data || distributionItem.isPending) {
if (!isLoaded) {
return null;
}

return this.props.distributionItem.data.title;
return formatMessage(
{ id: `panes.smsDistribution.title.${state}` },
{ title },
);
}

renderPaneContent(data) {
Expand Down

0 comments on commit 1a42735

Please sign in to comment.