From af41040297d61dc5bacc8d409b8dad19f6c5842f Mon Sep 17 00:00:00 2001 From: creations Date: Sat, 28 Mar 2026 21:31:55 -0500 Subject: [PATCH] BetterAudioPlayer: small changes (#938) --- .../betterAudioPlayer/index.tsx | 9 ++++---- src/equicordplugins/githubRepos/styles.css | 22 +++++++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/equicordplugins/betterAudioPlayer/index.tsx b/src/equicordplugins/betterAudioPlayer/index.tsx index a3034c6d0..1692b2d85 100644 --- a/src/equicordplugins/betterAudioPlayer/index.tsx +++ b/src/equicordplugins/betterAudioPlayer/index.tsx @@ -22,16 +22,15 @@ interface PlayerInstance { } function validateColor(value: string, key: string, fallback: string) { - const rgbPattern = /^\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}$/; - if (rgbPattern.test(value)) return; + if (/^\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}$/.test(value)) return; - if (value.startsWith("#")) { - const rgb = ColorUtils.hexToRgb(value); + try { + const rgb = ColorUtils.hexToRgb(value.replace("#", "")); if (rgb) { settings.store[key] = `${rgb.r}, ${rgb.g}, ${rgb.b}`; return; } - } + } catch { /* invalid hex */ } showToast(`Invalid color format for ${key}, use "R, G, B" or "#RRGGBB"`, Toasts.Type.FAILURE); settings.store[key] = fallback; diff --git a/src/equicordplugins/githubRepos/styles.css b/src/equicordplugins/githubRepos/styles.css index fdfe19b34..4d1791d1a 100644 --- a/src/equicordplugins/githubRepos/styles.css +++ b/src/equicordplugins/githubRepos/styles.css @@ -25,7 +25,11 @@ justify-content: center; margin-top: 2px; padding-top: 12px; - border-top: 1px solid var(--profile-body-divider-color, var(--input-border-default, var(--input-border))); + border-top: 1px solid + var( + --profile-body-divider-color, + var(--input-border-default, var(--input-border)) + ); } .vc-github-repos-button, @@ -37,7 +41,11 @@ .vc-github-repos-card { padding: 8px; border-radius: var(--radius-xs); - border: 1px solid var(--profile-body-divider-color, var(--input-border-default, var(--input-border))); + border: 1px solid + var( + --profile-body-divider-color, + var(--input-border-default, var(--input-border)) + ); } .vc-github-repos-header { @@ -227,19 +235,19 @@ } .vc-github-repos-header-repo { - width: 20% + width: 20%; } .vc-github-repos-header-description { - width: 50% + width: 50%; } .vc-github-repos-header-language { - width: 15% + width: 15%; } .vc-github-repos-header-stars { - width: 10% + width: 10%; } /* Tab variant styles */ @@ -291,4 +299,4 @@ .vc-github-repos-container.vc-github-repos-tab .vc-github-repos-star-icon, .vc-github-repos-container.vc-github-repos-tab .vc-github-repos-stars { margin-left: 2px; -} \ No newline at end of file +}