Added badge selection

This commit is contained in:
2019-06-08 10:20:10 +10:00
parent d8a7dd4933
commit 2a27572562
21 changed files with 396 additions and 15 deletions
+27
View File
@@ -0,0 +1,27 @@
import React from 'react';
class Badge extends React.Component {
constructor(props) {
super(props);
this.state = {
//
};
}
render() {
let realSize = typeof(this.props.size) === 'number' ? this.props.number : this.parseSize(this.props.size);
return (
<img {...this.props} src={`/img/badges/${this.props.filename}`} alt={this.props.name} width={realSize} height={realSize} />
);
}
parseSize(sizeString) {
if (sizeString === 'small') return 12;
if (sizeString === 'medium') return 20;
return 100;
}
};
export default Badge;