Fix routing issues. Fix panel layout.
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import Radium from 'radium'
|
||||
import React, { Component } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { sizeInfo } from './style'
|
||||
|
||||
// See https://www.flaticon.com/packs/free-basic-ui-elements
|
||||
|
||||
@Radium
|
||||
export class Icon extends Component {
|
||||
static propTypes = {
|
||||
name: PropTypes.string.isRequired,
|
||||
size: PropTypes.number,
|
||||
margin: PropTypes.number,
|
||||
style: PropTypes.object,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
@@ -33,11 +36,11 @@ export class Icon extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
let { size, name, margin } = this.props
|
||||
let { size, name, margin, style } = this.props
|
||||
let source = Icon.svgs[name] || Icon.svgs['placeholder']
|
||||
|
||||
size -= margin * 2
|
||||
|
||||
return <img style={{ width: size, height: size, margin }} src={source} />
|
||||
return <img style={[{ width: size, height: size, margin }, style]} src={source} />
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user