From 59c9c68e78fac2da7d0530b5d064507d2887015f Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 14 Feb 2024 23:01:05 -0800 Subject: [PATCH] code format with pre-commit --- docs/widgets/services/customapi.md | 2 +- src/widgets/customapi/component.jsx | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/widgets/services/customapi.md b/docs/widgets/services/customapi.md index e13874610..4bcd33fac 100644 --- a/docs/widgets/services/customapi.md +++ b/docs/widgets/services/customapi.md @@ -137,7 +137,7 @@ The list view utilizes extra space to display an additional field (which is opti `field`: Defined the key with the desired value for the additional information. -`color`: Define a color scheme to the additional information for customization and/or distinction. +`color`: Define a color scheme to the additional information for customization and/or distinction. Allowed options: `["theme", "adaptive", "black", "white"]`. Other values will be ignored. diff --git a/src/widgets/customapi/component.jsx b/src/widgets/customapi/component.jsx index 19a89a316..31b83c8a0 100644 --- a/src/widgets/customapi/component.jsx +++ b/src/widgets/customapi/component.jsx @@ -117,14 +117,14 @@ function getColor(mapping, customData) { } catch (e) { return ""; } - case ("black"): + case "black": return `text-black`; - case ("white"): + case "white": return `text-white`; - case ("theme"): + case "theme": return `text-theme-500`; default: - return "" + return ""; } } @@ -155,9 +155,7 @@ export default function Component({ service }) { >
{mapping.label}
-
- - -
+
-
))} @@ -188,11 +186,9 @@ export default function Component({ service }) { >
{mapping.label}
-
- {formatValue(t, mapping, getValue(mapping.field, customData))} -
+
{formatValue(t, mapping, getValue(mapping.field, customData))}
{mapping.additionalField && ( -
+
{formatValue(t, mapping.additionalField, getValue(mapping.additionalField.field, customData))}
)}