Merge branch 'fix-badge-crash' into 'main'
Badge: fix page crash when color isn't defined Closes #1650 See merge request soapbox-pub/soapbox!2996
This commit is contained in:
commit
87d04e6a0c
1 changed files with 3 additions and 1 deletions
|
@ -13,7 +13,9 @@ const Badge: React.FC<IBadge> = ({ title, slug, color }) => {
|
|||
const fallback = !['patron', 'admin', 'moderator', 'opaque', 'badge:donor'].includes(slug);
|
||||
|
||||
const isDark = useMemo(() => {
|
||||
const hsl = hexToHsl(color!);
|
||||
if (!color) return false;
|
||||
|
||||
const hsl = hexToHsl(color);
|
||||
|
||||
if (hsl && hsl.l > 50) return false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue