Demo entry 5413744

javascript

   

Submitted by anonymous on Jun 23, 2016 at 21:50
Language: JavaScript. Code size: 1.4 kB.

import React, { Component } from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { Map, List } from 'immutable'
import Store from './redux/store'
import App from './component/app'
import { generateRooms } from './util'

require('./less/index.less')

const state = Map({
  currentView: 'ROOMS_VIEW',
  navbarLinks: List([
    {name: 'Rooms', key: 'ROOMS_VIEW'},
    {name: 'Reports', key: 'REPORTS'}
  ]),
  roomListLayout: 'TILES',
  roomListsSelected: {group: 0, item: 0},
  roomLists: List([
    Map({
      name: "Filters",
      expanded: true,
      listItems: List([
        { icon: 'images/icon-warning.svg', name: 'Alerts', filter: room => room.hasAlert },
        { icon: 'images/icon-playlist.svg', name: 'In Progress', filter: room => room.progress > 20 },
        { icon: 'images/icon-playlist.svg', name: 'Almost Done', filter: room => room.progress > 90 },
        { icon: 'images/icon-playlist.svg', name: 'Complete', filter: room => room.status === 'complete' },
        { icon: 'images/icon-playlist.svg', name: 'Recently Completed', filter: room => false },
        { icon: 'images/icon-playlist.svg', name: 'All Rooms', filter: room => true }
      ])
    })
  ]),
  rooms: List(generateRooms())
})

let store = new Store(state)

render(<Provider store={store}><App /></Provider>, document.getElementById('react'))

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).