Javi Jimenez Villar 2015-07-29 10:27:52 +07:00
parent d7c3d1faad
commit 70334255ca
2 changed files with 15 additions and 15 deletions

View File

@ -1,5 +1,5 @@
require './style' localCSS = require './style'
FontIcon = require "../font_icon" FontIcon = require '../font_icon'
module.exports = React.createClass module.exports = React.createClass
@ -13,7 +13,8 @@ module.exports = React.createClass
route : React.PropTypes.array route : React.PropTypes.array
getDefaultProps: -> getDefaultProps: ->
attributes : "" attributes : ''
className : ''
# -- Events # -- Events
onClick: (event) -> onClick: (event) ->
@ -21,12 +22,10 @@ module.exports = React.createClass
# -- Render # -- Render
render: -> render: ->
<a data-component-link="" className = "#{localCSS.root} #{@props.className}"
href={"##{@props.route}"} <a data-react-toolbox='link' href={"##{@props.route}"} className={className}
className={@props.className} onClick={@onClick} data-flex='horizontal center'>
onClick={@onClick} { <FontIcon className={localCSS.icon} value={@props.icon} /> if @props.icon }
data-flex="horizontal center">
{ <FontIcon value={@props.icon} /> if @props.icon }
{ <abbr>{@props.caption}</abbr> if @props.caption } { <abbr>{@props.caption}</abbr> if @props.caption }
{ <small>{@props.count}</small> if @props.count and parseInt(@props.count) isnt 0} { <small>{@props.count}</small> if @props.count and parseInt(@props.count) isnt 0}
</a> </a>

View File

@ -1,9 +1,13 @@
@import "../constants.styl" @import '../constants'
[data-component-link] :local(.icon)
margin-right : (SPACE / 2)
font-size : FONT_SIZE_BIG
:local(.root)
position : relative position : relative
overflow : hidden overflow : hidden
transition opacity ANIMATION_DURATION ANIMATION_EASE transition : opacity ANIMATION_DURATION ANIMATION_EASE
// -- Styles // -- Styles
&:not(.active) &:not(.active)
font-weight : FONT_WEIGHT_THIN font-weight : FONT_WEIGHT_THIN
@ -15,9 +19,6 @@
// -- Children // -- Children
> * > *
vertical-align : middle vertical-align : middle
> .icon
margin-right : (SPACE / 2)
font-size : FONT_SIZE_BIG
> abbr > abbr
text-transform : Capitalize text-transform : Capitalize
> small > small