Sha256: 681727b38d61acae0112bd1c9ced56bdc219b42d296cfc129cecf619c2e043e4

Contents?: true

Size: 1.47 KB

Versions: 46

Compression:

Stored size: 1.47 KB

Contents

Rev.pullInto(this) 'Row', 'Col'

Rev.appComponent 'Revelry.Index',

  getInitialState: ->
    state =
      examples: "Rev"

  getScope: ->
    switch @state.examples
      when "Rev" then global.Rev
      when "App" then global.Rev.App

  onChangeView: (e) ->
    state = {}
    state[e.target.name] = e.target.value
    @setState state

  renderExample: (component, name) ->
    props = id: name
    if React.createElement?
      React.createElement(component, @props.options)
    else
      <component {...@props.options} />
    <Row key={name}>
      <hr />
      <h2>{name}</h2>
      {
        if React.createElement?
          React.createElement(component, props)
        else
          <component {...props} />
      }
    </Row>

  render: ->
    <div>
      <Row>
        <h1>Revelry Guide</h1>
        <Col large="2" medium="3" small="6">
          <label>
            <input
              type="radio"
              name="examples"
              value="Rev"
              checked={"Rev" == @state.examples}
              onChange={@onChangeView}
            /> Revelry
          </label>
        </Col>
        <Col large="2" medium="3" small="6" end>
          <label>
            <input
              type="radio"
              name="examples"
              value="App"
              checked={"App" == @state.examples}
              onChange={@onChangeView}
            /> Application
          </label>
        </Col>
      </Row>
      {_.map @getScope().Examples, @renderExample}
    </div>

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
revelry_core-0.1.12.6 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.12.5 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.12.4 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.12.3 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.12.2 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.12.0 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.11.6 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.11.5 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.11.2 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.11.1 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.11.0 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.7 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.6 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.5 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.4 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.3 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.2 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.1 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.10.0 app/assets/javascripts/revelry/guide/Index.js.cjsx
revelry_core-0.1.9.2 app/assets/javascripts/revelry/guide/Index.js.cjsx