31 lines
639 B
JavaScript
31 lines
639 B
JavaScript
import Radium from 'radium'
|
|
import PropTypes from 'prop-types'
|
|
import React, { Component } from 'react'
|
|
import { fontInfo } from './style'
|
|
|
|
class Link extends Component {
|
|
static propTypes = {
|
|
to: PropTypes.string,
|
|
size: PropTypes.string,
|
|
margin: PropTypes.number,
|
|
children: PropTypes.node
|
|
}
|
|
|
|
static defaultProps = {
|
|
size: 'medium',
|
|
margin: 0
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<a href={this.props.to} style={{
|
|
fontSize: fontInfo.size[this.props.size],
|
|
fontFamily: fontInfo.family,
|
|
margin: this.props.margin
|
|
}}>{this.props.children}</a>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default Radium(Link)
|