2019-04-11 08:05:53 +12:00
|
|
|
import React, { memo } from 'react';
|
2020-07-23 21:07:08 +12:00
|
|
|
import { I18n } from '../locale';
|
2018-06-15 19:58:17 +12:00
|
|
|
|
2019-04-11 08:05:53 +12:00
|
|
|
export default memo((props) => {
|
2019-09-05 15:36:11 +12:00
|
|
|
if (props.popularity === undefined || props.popularity === null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2018-06-15 19:58:17 +12:00
|
|
|
|
2019-09-05 15:36:11 +12:00
|
|
|
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">
|
2020-07-23 21:07:08 +12:00
|
|
|
<I18n path="specs.popularity" percent={props.popularity} />
|
2019-09-05 15:36:11 +12:00
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
);
|
2020-07-23 21:07:08 +12:00
|
|
|
});
|