kyd-shared-badge 0.3.130 → 0.3.132
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -11,12 +11,17 @@ import { green1, green2, green3, green4, green5 } from '../colors';
|
|
|
11
11
|
// Register English locale once at module import time
|
|
12
12
|
countriesLib.registerLocale(enLocale);
|
|
13
13
|
|
|
14
|
-
export const getBadgeImageUrl = (score: number, bland: boolean = false) => {
|
|
14
|
+
export const getBadgeImageUrl = (score: number, bland: boolean = false, selfCheck?: boolean) => {
|
|
15
|
+
if (selfCheck) { // self-check badges are always green
|
|
16
|
+
return bland ? 'badgegreensimple.png' : '/badgegreen2.png';
|
|
17
|
+
};
|
|
18
|
+
|
|
15
19
|
if (score >= 75) return bland ? 'badgegreensimple.png' : '/badgegreen2.png';
|
|
16
20
|
if (score >= 50) return bland ? 'badgeyellowsimple.png' : '/badgeyellow2.png';
|
|
17
21
|
return bland ? 'badgeredsimple.png' : '/badgered2.png';
|
|
18
22
|
};
|
|
19
23
|
|
|
24
|
+
|
|
20
25
|
const hexToRgba = (hex: string, alpha: number) => {
|
|
21
26
|
const clean = hex.replace('#', '');
|
|
22
27
|
const r = parseInt(clean.substring(0, 2), 16);
|
|
@@ -24,7 +24,7 @@ export default function TopContributingFactors({
|
|
|
24
24
|
{topRules.map((r, idx: number) => (
|
|
25
25
|
<div key={idx} className="flex items-center gap-2 text-xs" style={{ color: 'var(--text-secondary)' }}>
|
|
26
26
|
<span className={'relative inline-flex items-center group'} style={{ color: 'var(--text-secondary)' }}>
|
|
27
|
-
<ProviderIcon name={r.provider} />
|
|
27
|
+
<ProviderIcon name={r.provider} className="size-4 relative" />
|
|
28
28
|
<div className="hidden group-hover:block absolute z-30 left-1/2 -translate-x-1/2 top-full mt-2 w-80">
|
|
29
29
|
<div style={{ background: 'var(--content-card-background)', border: '1px solid var(--icon-button-secondary)', color: 'var(--text-main)', padding: 10, borderRadius: 6 }}>
|
|
30
30
|
<div style={{ fontWeight: 600 }}>{getProviderDisplayName(r.provider)}</div>
|