mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 07:30:00 +00:00
45 lines
914 B
JavaScript
45 lines
914 B
JavaScript
import React from 'react'
|
|
import Paragraph from './Paragraph'
|
|
import colors from '../config/colors'
|
|
import { fontSizes, margins } from '../config/scales'
|
|
|
|
class MessagePanel extends React.Component {
|
|
static propTypes = {
|
|
errors: React.PropTypes.array,
|
|
infos: React.PropTypes.array,
|
|
}
|
|
|
|
render() {
|
|
const paragraphStyle = {
|
|
margin: 0,
|
|
lineHeight: 1.2,
|
|
}
|
|
|
|
const errors = this.props.errors.map((m, i) => {
|
|
return <Paragraph key={i}
|
|
style={{
|
|
...paragraphStyle,
|
|
color: colors.red,
|
|
}}>{m}</Paragraph>
|
|
})
|
|
|
|
const infos = this.props.infos.map((m, i) => {
|
|
return <Paragraph key={i}
|
|
style={{
|
|
...paragraphStyle,
|
|
color: colors.lowgray,
|
|
}}>{m}</Paragraph>
|
|
})
|
|
|
|
return <div style={{
|
|
padding: margins[1],
|
|
}}>
|
|
{errors}
|
|
{infos}
|
|
</div>
|
|
}
|
|
}
|
|
|
|
|
|
export default MessagePanel
|