miguelalarcos:react-modal

v0.1.0Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

react-modal

A simple modal for React Meteor.

Example

For this example you have to meteor add miguelalarcos:react-model-mixins.

DemoModal = React.createClass
    mixins: [RMMx.changeDatatMx]
    ok: ->
        @props.okCallback(@state.file)
        modal.close()
    cancel: ->
        modal.close()
    getInitialState: ->
        file: @props.file
    render: ->
        <div>
            <input type='text' value=@state.file onChange=@changeDataText('file') />
            <button onClick=@ok>ok</button>
            <button onClick=@cancel>cancel</button>
        </div>


@MainLayout = React.createClass
    okCallback: (file) ->
        console.log file
    modal: ->
        modal.show <DemoModal file='file1.txt' okCallback=@okCallback />
    render: ->
        <div>
            <button onClick=@modal>modal</button>
            <modal.Modal />
        </div>