Icon
parent
d7c3d1faad
commit
70334255ca
|
@ -1,5 +1,5 @@
|
|||
require './style'
|
||||
FontIcon = require "../font_icon"
|
||||
localCSS = require './style'
|
||||
FontIcon = require '../font_icon'
|
||||
|
||||
module.exports = React.createClass
|
||||
|
||||
|
@ -13,7 +13,8 @@ module.exports = React.createClass
|
|||
route : React.PropTypes.array
|
||||
|
||||
getDefaultProps: ->
|
||||
attributes : ""
|
||||
attributes : ''
|
||||
className : ''
|
||||
|
||||
# -- Events
|
||||
onClick: (event) ->
|
||||
|
@ -21,12 +22,10 @@ module.exports = React.createClass
|
|||
|
||||
# -- Render
|
||||
render: ->
|
||||
<a data-component-link=""
|
||||
href={"##{@props.route}"}
|
||||
className={@props.className}
|
||||
onClick={@onClick}
|
||||
data-flex="horizontal center">
|
||||
{ <FontIcon value={@props.icon} /> if @props.icon }
|
||||
className = "#{localCSS.root} #{@props.className}"
|
||||
<a data-react-toolbox='link' href={"##{@props.route}"} className={className}
|
||||
onClick={@onClick} data-flex='horizontal center'>
|
||||
{ <FontIcon className={localCSS.icon} value={@props.icon} /> if @props.icon }
|
||||
{ <abbr>{@props.caption}</abbr> if @props.caption }
|
||||
{ <small>{@props.count}</small> if @props.count and parseInt(@props.count) isnt 0}
|
||||
</a>
|
||||
|
|
|
@ -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
|
||||
overflow : hidden
|
||||
transition opacity ANIMATION_DURATION ANIMATION_EASE
|
||||
transition : opacity ANIMATION_DURATION ANIMATION_EASE
|
||||
// -- Styles
|
||||
&:not(.active)
|
||||
font-weight : FONT_WEIGHT_THIN
|
||||
|
@ -15,9 +19,6 @@
|
|||
// -- Children
|
||||
> *
|
||||
vertical-align : middle
|
||||
> .icon
|
||||
margin-right : (SPACE / 2)
|
||||
font-size : FONT_SIZE_BIG
|
||||
> abbr
|
||||
text-transform : Capitalize
|
||||
> small
|
||||
|
|
Loading…
Reference in New Issue