Data4Democracy / ati-broadcastapp

The ATI Broadcast app group is building a Facebook publishing app for the group America the Indivisible. Via this app an AITD trusted partner will be able to broadcast a message to multiply Facebook groups from one interface. This will allow the local groups in a region, of which there are many, to better communicate and mobilize toward specific actions.
MIT License
7 stars 2 forks source link

Messaging front end #29

Closed marcuslyons closed 7 years ago

jonganc commented 7 years ago

Thanks Marcus. It looks good!

I had a few thoughts:

jonganc commented 7 years ago

It looks better!

I have a few more thoughts.

1) cancelMessage needs an event argument.

2) Instead of having completely separate code for editing and confirm, it might be better to have the textarea part in common and then use conditional code to add disabled and the additional buttons only for the confirm status.

For example, the textarea code could be:

<textarea
  name=""
  value={this.state.message}
  id=""
  cols="30"
  rows="10"
  disabled={this.state.status !== 'editing'}
/>

(and similarly for the button). Similarly, the extra content for the confirmation can be saved into a variable, like so:

const confirmation = this.state.status === 'editing' ? null :
    (<div>
        <p
          style={{ marginTop: '0.5em' }}
        >
          This message will post to all
          groups in your jurisdiction.
          OK to continue, cancel to continue
          editing.
          ....
     </div>);

(Note that code always has to be wrapped in a single tag, so you will need a surrounding div).

Then you can have

content = (
  <div>...
    </button>
    {confirmation}
  </div>
);