Got the BadgeText working
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import Badge from './badge.jsx';
|
||||
|
||||
class BadgeText extends React.Component {
|
||||
render() {
|
||||
if (!this.props.filename) {
|
||||
return (
|
||||
<p {...this.props}>{this.props.children}</p>
|
||||
);
|
||||
}
|
||||
|
||||
let centerStyle = {
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
};
|
||||
|
||||
let leftStyle = {
|
||||
display: 'flex'
|
||||
};
|
||||
|
||||
let style = this.props.centered ? centerStyle : leftStyle;
|
||||
|
||||
return (
|
||||
<div {...this.props} style={{...style, paddingBottom: '0.5em'}}>
|
||||
<Badge name={this.props.name} filename={this.props.filename} size={this.props.size} />
|
||||
<p style={{paddingBottom: 0}}>{this.props.children}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default BadgeText;
|
||||
Reference in New Issue
Block a user