diff --git a/app/javascript/components/tpi/AscorQuestionLegend.js b/app/javascript/components/tpi/AscorQuestionLegend.js index cfae07a62..c814e65f4 100644 --- a/app/javascript/components/tpi/AscorQuestionLegend.js +++ b/app/javascript/components/tpi/AscorQuestionLegend.js @@ -7,25 +7,33 @@ const AscorQuestionLegend = () => { const isChecked = () => { let anyChecked = false; - document.querySelectorAll('.country-assessment > .country-assessment__pillar').forEach((section) => { - let areaChecked = false; + document + .querySelectorAll('.country-assessment > .country-assessment__pillar') + .forEach((section) => { + let areaChecked = false; - section.querySelectorAll('input.toggle').forEach((input) => { - areaChecked = areaChecked || input.checked; - anyChecked = anyChecked || input.checked; + section.querySelectorAll('input.toggle').forEach((input) => { + areaChecked = areaChecked || input.checked; + anyChecked = anyChecked || input.checked; + }); + return areaChecked + ? section.classList.add('active') + : section.classList.remove('active'); }); - return areaChecked ? section.classList.add('active') : section.classList.remove('active'); - }); setVisible(anyChecked); }; useEffect(() => { const eventListeners = []; - document.querySelectorAll('.country-assessment > .country-assessment__pillar > input.toggle').forEach((input) => { - const listener = input.addEventListener('click', isChecked); - eventListeners.push([input, listener]); - }); + document + .querySelectorAll( + '.country-assessment > .country-assessment__pillar > input.toggle' + ) + .forEach((input) => { + const listener = input.addEventListener('click', isChecked); + eventListeners.push([input, listener]); + }); return () => { eventListeners.forEach(([input, listener]) => { @@ -35,10 +43,12 @@ const AscorQuestionLegend = () => { }); return ( -
-
- Legend -
+
+
Legend
No @@ -59,14 +69,13 @@ const AscorQuestionLegend = () => { No disclosure
- Excempt + Exempt
); }; -AscorQuestionLegend.propTypes = { -}; +AscorQuestionLegend.propTypes = {}; export default AscorQuestionLegend; diff --git a/app/views/tpi/ascor/_contact.html.erb b/app/views/tpi/ascor/_contact.html.erb index a06418e1f..d4ad04cbe 100644 --- a/app/views/tpi/ascor/_contact.html.erb +++ b/app/views/tpi/ascor/_contact.html.erb @@ -2,7 +2,6 @@

Get in touch with us for enquiries.

-

At ASCOR, we are here to help and answer any questions you may have. Contact us at gri.ascor@lse.ac.uk.

Contact ASCOR
\ No newline at end of file