Got the BadgeText working

This commit is contained in:
2019-06-08 13:33:09 +10:00
parent 2a27572562
commit 13ff97b1a2
9 changed files with 229 additions and 89 deletions
+33
View File
@@ -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;