From 4c4d47d049828c7a04ff81e223cbd717d371fd7d Mon Sep 17 00:00:00 2001 From: Ted Ian Osias Date: Wed, 3 Sep 2025 23:45:02 +0800 Subject: [PATCH] chore: remove unnecessary comments --- src/components/faq/FaqItem.jsx | 27 +-------------------------- src/components/faq/FaqList.jsx | 15 +++------------ 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/src/components/faq/FaqItem.jsx b/src/components/faq/FaqItem.jsx index 6804c952..3a4a2f05 100644 --- a/src/components/faq/FaqItem.jsx +++ b/src/components/faq/FaqItem.jsx @@ -16,32 +16,7 @@ import {Collapse} from "react-collapse"; */ const FaqItem = ({faq, index}) => { const [isActive, setIsActive] = useState(false); - // const re = new RegExp('target="_blank"', 'gmi'); - - /* TODO */ - /* - * the text editor for creating the FAQ does not add the rel = "noopener" - therefore DOMPurify.sanitize (faq.description) removes the target = "_ blank" from the images - * function array_move(arr, old_index, new_index) { - if (new_index >= arr.length) { - let k = new_index - arr.length + 1; - while (k--) { - arr.push(undefined); - } - } - arr.splice(new_index, 0, arr.splice(old_index, 1)[0]); - return arr; // for testing - }; - - const assignText = faq.description.split(' ').filter((e) => { - if (re.exec(e)) { - let j=array_move(e.split('>').concat('rel="noopener"'), 2, 1) - return j.join('>').replace('/>/',' ') - }else{ - return e; - } - }); - * */ + const toggleActive = () => setIsActive(!isActive); diff --git a/src/components/faq/FaqList.jsx b/src/components/faq/FaqList.jsx index 5f21a132..3bb02051 100644 --- a/src/components/faq/FaqList.jsx +++ b/src/components/faq/FaqList.jsx @@ -28,10 +28,7 @@ const FaqList = () => { const isMounted = useRef(false); const cancelSource = useMemo(() => axios.CancelToken.source(), []); - /** - * function that load all the questions from the API - * @function - */ + const loadQuestions = useCallback(async () => { setDataload(0); try { @@ -48,18 +45,12 @@ const FaqList = () => { } }, [cancelSource]); - /** - * UseEffect that loads the questions - * @function - */ + useEffect(() => { loadQuestions(); }, [loadQuestions]); - /** - * UseEffect that handles the mounting and unmounting and cancels requests - * @function - */ + useEffect(() => { isMounted.current = true; return () => {