1
40%
MIT
Bucklescript bindings for react-trello

bs-react-trello

This is Bucklescript bindings for react-trello.

Install

yarn add bs-react-trello

Setup

Add bs-react-trello to bs-depenencies in your bsconfig.json!

{
  /* ... */
  "bs-dependencies": [
    "bs-react-trello"
  ],
  /* ... */
}

Example

  • RE
  • ML
let data = [|
  ReactTrello.Lane.t(
    ~id="title1",
    ~label="title1 label",
    ~addCardLink=React.string("title 1 addCardLink"),
    ~cards=[|
      ReactTrello.Card.t(
        ~id="t1 card1",
        ~title="t1 title1",
        ~description="t1 description",
        (),
      ),
      ReactTrello.Card.t(
        ~id="t2 card1",
        ~title="t2 title1",
        ~description="t2 description",
        (),
      ),
    |],
    (),
  ),
  ReactTrello.Lane.t(
    ~id="title2",
    ~label="title2 label",
    ~addCardLink=React.string("title 2 addCardLink"),
    ~cards=[||],
    (),
  ),
|];

[@react.component]
let make = () =>
  <div className="container"> <ReactTrello data={"lanes": data} /> </div>;
let data =
  [|(ReactTrello.Lane.t ~id:"title1" ~label:"title1 label"
       ~addCardLink:(React.string "title 1 addCardLink")
       ~cards:[|(ReactTrello.Card.t ~id:"t1 card1" ~title:"t1 title1"
                   ~description:"t1 description" ());(ReactTrello.Card.t
                                                        ~id:"t2 card1"
                                                        ~title:"t2 title1"
                                                        ~description:"t2 description"
                                                        ())|] ());(ReactTrello.Lane.t
                                                                    ~id:"title2"
                                                                    ~label:"title2 label"
                                                                    ~addCardLink:(
                                                                    React.string
                                                                    "title 2 addCardLink")
                                                                    ~cards:
                                                                    [||] ())|]
let make () =
  ((div ~className:"container"
      ~children:[((ReactTrello.createElement
                     ~data:([%bs.obj { lanes = data }]) ~children:[] ())
                [@JSX ])] ())[@JSX ])[@@react.component ]