slack-react

0.3.0 • Public • Published

React Slack

React components for building slack messages

const BoardRequest = ({ command, train }) => {
  const { place, time, passengers } = train;
  return (
    <Message>
      <Attachment callbackId="magic-callback-id" fallback="To board the train, DM the conductor" author="foo" markdownIn={['foo', 'bar']} title="some title">
                Chew choo! <User id={command.user_id} /> started a train to {place} at {time}.
        { passengers.length > 0 ? passengers
                    .map(passenger => <User key={passenger.id} id={passenger.id} />) : null} Will you join?
 
        <Field title="Time" short>{time}</Field>
 
        <Button name="board">Board the Train</Button>
      </Attachment>
    </Message>
  );
};

Readme

Keywords

Package Sidebar

Install

npm i slack-react

Weekly Downloads

2

Version

0.3.0

License

ISC

Unpacked Size

24.1 kB

Total Files

25

Last publish

Collaborators

  • barlock