Merge version_2_1777971818753 into main #1
26
src/App.tsx
26
src/App.tsx
@@ -1,8 +1,32 @@
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
import Layout from './components/Layout';
|
||||
import HomePage from './pages/HomePage';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function App() {
|
||||
useEffect(() => {
|
||||
// Dynamically locate the FAQ div and apply the requested text-red-500 class
|
||||
const applyRedText = () => {
|
||||
const elements = document.querySelectorAll('div');
|
||||
elements.forEach((el) => {
|
||||
const text = el.textContent || '';
|
||||
if (
|
||||
text.includes('FAQs') &&
|
||||
text.includes('Common Questions') &&
|
||||
text.includes('Get your questions answered.')
|
||||
) {
|
||||
el.classList.add('text-red-500');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
applyRedText();
|
||||
const observer = new MutationObserver(applyRedText);
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Routes>
|
||||
<Route element={<Layout />}>
|
||||
@@ -10,4 +34,4 @@ export default function App() {
|
||||
</Route>
|
||||
</Routes>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user