diff --git a/frontend/src/Editor/Components/Statistics.jsx b/frontend/src/Editor/Components/Statistics.jsx index f3d20f1a57..b3686db46d 100644 --- a/frontend/src/Editor/Components/Statistics.jsx +++ b/frontend/src/Editor/Components/Statistics.jsx @@ -1,6 +1,7 @@ import React from 'react'; export const Statistics = function Statistics({ height, properties, styles, darkMode }) { - const { primaryValueLabel, primaryValue, secondaryValueLabel, secondaryValue, secondarySignDisplay } = properties; + const { primaryValueLabel, primaryValue, secondaryValueLabel, secondaryValue, secondarySignDisplay, hideSecondary } = + properties; const { primaryLabelColour, primaryTextColour, secondaryLabelColour, secondaryTextColour, visibility } = styles; const baseStyle = { @@ -73,29 +74,36 @@ export const Statistics = function Statistics({ height, properties, styles, dark {primaryValueLabel}

{primaryValue}

-
-
- {secondarySignDisplay !== 'negative' ? ( - - ) : ( - - )} -

{secondaryValue}

+ {hideSecondary ? ( + '' + ) : ( +
+
+ {secondarySignDisplay !== 'negative' ? ( + + ) : ( + + )} +

{secondaryValue}

+
+

+ {secondaryValueLabel} +

-

- {secondaryValueLabel} -

-
+ )}
); }; diff --git a/frontend/src/Editor/Components/components.js b/frontend/src/Editor/Components/components.js index d4ce75b149..e7feab64d9 100644 --- a/frontend/src/Editor/Components/components.js +++ b/frontend/src/Editor/Components/components.js @@ -1822,6 +1822,7 @@ export const componentTypes = [ properties: { primaryValueLabel: { type: 'code', displayName: 'Primary value label' }, primaryValue: { type: 'code', displayName: 'Primary value' }, + hideSecondary: { type: 'toggle', displayName: 'Hide secondary value' }, secondaryValueLabel: { type: 'code', displayName: 'Secondary value label' }, secondaryValue: { type: 'code', displayName: 'Secondary value' }, secondarySignDisplay: { type: 'code', displayName: 'Secondary sign display' },