ES6 Plato on Github
Report Home
Summary Display
components/Event/EventProperty.js
Maintainability
74.06
Lines of code
55
Difficulty
16.42
Estimated Errors
0.14
Function weight
By Complexity
By SLOC
import React from 'react' /** * This represents event properties such as authorship, tags updating time for example */ class EventProperty extends React.Component { render() { const propertyName = this.props.propertyName; const propertyValue = this.props.propertyValue; function leftPart() { // if (propertyName === 'creationAuthorship') { // return <Glyphicon glyph='user' /> // } } function middlePart() { if (propertyName === 'creationAuthorship') { return <span className='padding-left-5' style={{ fontStyle: 'italic' }}> Created by {propertyValue} </span> } if (propertyName === 'updateAuthorship') { return <span className='padding-left-5' style={{ fontStyle: 'italic' }}> Updated by {propertyValue} </span> } if (propertyName === 'historyAuthorship') { return <span className='padding-left-5' style={{ fontStyle: 'italic' }}> Commented by {propertyValue} </span> } } function rightPart() { /* this is temporarily desactivated because there is yet no action associated to the ...*/ // if (propertyName === 'creationAuthorship') { // return (<span style={{ backgroundColor: '#FFFFFF' }}>...</span>) // } // if (propertyName === 'updateAuthorship') { // return (<span style={{ backgroundColor: '#FFFFFF' }}>...</span>) // } return <span> </span> } return ( <span style={{ border: 'solid 1px #FFFFFF' }} > {leftPart()} {middlePart()} {rightPart()} </ span> ) } } export default EventProperty