Sha256: d1261d35ac9666d8e16cee136144c1f26af286c5e8189060481e31bd51801f24

Contents?: true

Size: 890 Bytes

Versions: 3

Compression:

Stored size: 890 Bytes

Contents

stylish = require("../apis/index").stylish

TiledGrid = require("../components/tiled_grid")

page "HomePage"

helpers
  showPackage: (pkg)->
    <div className="ui card" key={pkg.slug}>
      <Link href="/packages/#{ pkg.slug }">{pkg.name}</Link>
    </div>

state
  loaded: false
  packages: []

properties
  fullWidth: false

helpers
  isLoaded: -> 
    @state.loaded is true

events
  componentDidMount: ->
    @fetchStateFromApi() unless @isLoaded()

  fetchStateFromApi: ->
    page = @

    stylish.browsePackages (response)->
      page.setState(packages: response, loaded: true)

view ->
  <div className="ui body">
    <div className="ui header">
      <h4>Stylish Packages</h4>
    </div>

    <TiledGrid perRow=4 
               items={@state.packages} 
               formatter={@showPackage} 
               itemClass="stylish-package" />
  </div>

module.exports = finished()

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stylish-0.3.1 support/editor-app/development/src/pages/home.cjsx
stylish-0.3.0 support/editor-app/development/src/pages/home.cjsx
stylish-0.0.2 support/editor-app/development/src/pages/home.cjsx