tangled
alpha
login
or
join now
keii.dev
/
osu-web
the browser-facing portion of osu!
0
fork
atom
overview
issues
pulls
pipelines
Remove extra function for PpValue title and content
clayton
2 years ago
6e6ae54b
cb6f81ea
+14
-12
1 changed file
expand all
collapse all
unified
split
resources
js
scores
pp-value.tsx
+14
-12
resources/js/scores/pp-value.tsx
···
11
11
suffix?: React.ReactNode;
12
12
}
13
13
14
14
-
export default function PpValue(props: Props) {
15
15
-
const [title, content] = getTitleAndContent(props);
16
16
-
17
17
-
return <span title={title}>{content}</span>;
18
18
-
}
19
19
-
20
20
-
function getTitleAndContent({ score, suffix }: Props): [string, React.ReactNode] {
14
14
+
export default function PpValue({ score, suffix }: Props) {
21
15
if (score.type !== 'solo_score' && score.best_id == null) {
22
22
-
return [trans('scores.status.non_best'), '-'];
16
16
+
return <span title={trans('scores.status.non_best')}>-</span>;
23
17
}
24
18
25
19
if (
26
20
score.type === 'solo_score' &&
27
21
(!score.preserve || !score.ranked || (score.pp == null && score.processed))
28
22
) {
29
29
-
return [trans('scores.status.no_pp'), '-'];
23
23
+
return <span title={trans('scores.status.no_pp')}>-</span>;
30
24
}
31
25
32
26
if (score.pp == null) {
33
33
-
// eslint-disable-next-line react/jsx-key
34
34
-
return [trans('scores.status.processing'), <span className='fas fa-sync' />];
27
27
+
return (
28
28
+
<span title={trans('scores.status.processing')}>
29
29
+
<span className='fas fa-sync' />
30
30
+
</span>
31
31
+
);
35
32
}
36
33
37
37
-
return [formatNumber(score.pp), <>{formatNumber(Math.round(score.pp))}{suffix}</>];
34
34
+
return (
35
35
+
<span title={formatNumber(score.pp)}>
36
36
+
{formatNumber(Math.round(score.pp))}
37
37
+
{suffix}
38
38
+
</span>
39
39
+
);
38
40
}