Commit ce9a63c5 authored by Stephanie Kirtiadi's avatar Stephanie Kirtiadi
Browse files

Not render counter on the html on donate page if counter is not checked.

As per code review.

Issue #48277
parent fc2059cd
lego @ ac704338
Subproject commit 7eaaf3cae38ac55dd3c19657491acfd96f6b3b15
Subproject commit ac7043380033d2bc2a1bb8392607d718c98c3326
......@@ -21,17 +21,13 @@ const counters = [
];
export function CampaignTotals(props) {
const {donateProccessorBaseUrl, showCounter} = props;
const {donateProccessorBaseUrl} = props;
const [amounts, setAmounts] = useState({
'totalDonations': 0,
'totalAmount': 0,
'amountWithMozilla': 0
});
if (showCounter !== 'True') {
return null;
}
const requestTotal = async () => {
const options = {
headers: {
......
<div>
{{ this.intro }}
</div>
<div class="donate-form">
<div id="campaign-totals-area"></div>
<div id="giving-form"></div>
<div id="loading-dialog"></div>
</div>
<script type="text/javascript" src="https://js.stripe.com/v3/"></script>
<script type="text/javascript" src="https://www.paypal.com/sdk/js?client-id={{ bag('donate', envvars('ENV'), 'paypalClientId') }}&vault=true"></script>
<script type="text/javascript">
window.reactComponents = [
{
id: 'campaign-totals-area',
name: 'CampaignTotals',
props: {
showCounter: `{{ this.counter }}`,
'donateProccessorBaseUrl': `{{ bag('donate', envvars('ENV'), 'donateProccessorBaseUrl') }}`,
},
},
{
id: 'loading-dialog',
name: 'LoadingDialog',
......@@ -151,4 +138,22 @@
}
];
</script>
<script type="text/javascript" src="/static/gen/donate.js"></script>
<div class="donate-form">
{% if this.counter %}
<div id="campaign-totals-area"></div>
<script type="text/javascript">
window.reactComponents.push(
{
id: 'campaign-totals-area',
name: 'CampaignTotals',
props: {
'donateProccessorBaseUrl': `{{ bag('donate', envvars('ENV'), 'donateProccessorBaseUrl') }}`,
},
}
);
</script>
{% endif %}
<div id="giving-form"></div>
<div id="loading-dialog"></div>
<script type="text/javascript" src="/static/gen/donate.js"></script>
</div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment