Commit 30217f52 authored by Stephanie Kirtiadi's avatar Stephanie Kirtiadi
Browse files

Only make the counter appears when the show counter checkbox is checked.

Issue #48277
parent 412b2d1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ label = URL to redirect to after donation completed successfully
type = url

[fields.counter]
label = Display Counter
label = Display matching campaign counter?
type = boolean

[fields.single_one]
+5 −1
Original line number Diff line number Diff line
@@ -21,13 +21,17 @@ const counters = [
];

export function CampaignTotals(props) {
  const {donateProccessorBaseUrl} = props;
  const {donateProccessorBaseUrl, showCounter} = props;
  const [amounts, setAmounts] = useState({
    'totalDonations': 0,
    'totalAmount': 0,
    'amountWithMozilla': 0
  });

  if (showCounter !== 'True') {
    return null;
  }

  const requestTotal = async () => {
    const options = {
      headers: {