Javi Jimenez Villar 2015-07-29 10:30:07 +07:00
parent 70334255ca
commit ca53e73eeb
2 changed files with 13 additions and 10 deletions

View File

@ -1,4 +1,4 @@
require './style' localCSS = require './style'
module.exports = React.createClass module.exports = React.createClass
@ -11,9 +11,10 @@ module.exports = React.createClass
type : React.PropTypes.string type : React.PropTypes.string
getDefaultProps: -> getDefaultProps: ->
attributes : "" attributes : ''
className : ''
dataSource : [] dataSource : []
type : "default" type : 'default'
# -- Events # -- Events
onClick: (event, item) -> onClick: (event, item) ->
@ -21,7 +22,10 @@ module.exports = React.createClass
# -- Render # -- Render
render: -> render: ->
<ul data-component-list={@props.type}> className = "#{localCSS.root} #{@props.className}"
className += " #{@props.type}" if @props.type
<ul data-react-toolbox='list' className={className}>
{ {
for item, index in @props.dataSource for item, index in @props.dataSource
<li key={index} onClick={@onClick.bind null, item}> <li key={index} onClick={@onClick.bind null, item}>

View File

@ -1,6 +1,6 @@
@import "../constants.styl" @import '../constants'
[data-component-list] :local(.root)
list-style : none list-style : none
&, a &, a
color : TEXT color : TEXT
@ -8,9 +8,8 @@
overflow : hidden overflow : hidden
background-color : WHITE background-color : WHITE
box-shadow : ZDEPTH_SHADOW_1 box-shadow : ZDEPTH_SHADOW_1
transition-property box-shadow transition-property : box-shadow
transition-duration ANIMATION_DURATION transition-duration : ANIMATION_DURATION
transition-timing-function ANIMATION_EASE transition-timing-function : ANIMATION_EASE
// -- Classes
&:hover &:hover
box-shadow : ZDEPTH_SHADOW_2 box-shadow : ZDEPTH_SHADOW_2