Files
Iris/src/js/components/Popularity.js
James Barnsley e4d53a2d35 Auto eslint fix
2019-09-05 15:36:11 +12:00

25 lines
782 B
JavaScript
Executable File

import React, { memo } from 'react';
export default memo((props) => {
if (props.popularity === undefined || props.popularity === null) {
return null;
}
return (
<span className="popularity">
<span className="popularity-bars">
<span className={`bar${props.popularity > 10 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 30 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 50 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 70 ? ' filled' : ''}`} />
<span className={`bar${props.popularity > 90 ? ' filled' : ''}`} />
</span>
<span className="popularity-value">
{props.popularity}
% popularity
</span>
</span>
);
});