mirror of
https://github.com/Leado123/Leado123.github.io.git
synced 2026-10-01 00:32:59 +00:00
ads
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.12.6",
|
"@apollo/client": "^3.12.6",
|
||||||
|
"@ctrl/react-adsense": "^1.8.0",
|
||||||
"@jcamp/vitepress-blog-theme": "^0.3.0",
|
"@jcamp/vitepress-blog-theme": "^0.3.0",
|
||||||
"@mdxeditor/editor": "^3.25.1",
|
"@mdxeditor/editor": "^3.25.1",
|
||||||
"@million/lint": "latest",
|
"@million/lint": "latest",
|
||||||
|
|||||||
+29
-22
@@ -5,6 +5,7 @@ import SyllabusListing, { ClassListing } from './components/syllabus_comp';
|
|||||||
|
|
||||||
|
|
||||||
import server from './main'
|
import server from './main'
|
||||||
|
import { Adsense } from "@ctrl/react-adsense"
|
||||||
|
|
||||||
import Select from "react-select"
|
import Select from "react-select"
|
||||||
import AsyncSelect from "react-select/async";
|
import AsyncSelect from "react-select/async";
|
||||||
@@ -75,32 +76,32 @@ function App() {
|
|||||||
// Perform a search with initialQuery on startup
|
// Perform a search with initialQuery on startup
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialQuery) {
|
if (initialQuery) {
|
||||||
setQuery(initialQuery); // Set the query to initialQuery
|
setQuery(initialQuery); // Set the query to initialQuery
|
||||||
setDebouncedQuery(initialQuery); // Ensure debouncedQuery is also updated
|
setDebouncedQuery(initialQuery); // Ensure debouncedQuery is also updated
|
||||||
setInitialized(true); // Mark the component as initialized
|
setInitialized(true); // Mark the component as initialized
|
||||||
handleSearch(initialQuery); // Perform the search with initialQuery
|
handleSearch(initialQuery); // Perform the search with initialQuery
|
||||||
console.log("Performing search with initialQuery:", initialQuery);
|
console.log("Performing search with initialQuery:", initialQuery);
|
||||||
} else {
|
} else {
|
||||||
// If no initialQuery, fallback to debouncedQuery
|
// If no initialQuery, fallback to debouncedQuery
|
||||||
setInitialized(true); // Mark the component as initialized
|
setInitialized(true); // Mark the component as initialized
|
||||||
handleSearch(debouncedQuery); // Perform the search with debouncedQuery
|
handleSearch(debouncedQuery); // Perform the search with debouncedQuery
|
||||||
console.log("No initialQuery, performing search with debouncedQuery:", debouncedQuery);
|
console.log("No initialQuery, performing search with debouncedQuery:", debouncedQuery);
|
||||||
}
|
}
|
||||||
}, []); // Run only on component mount
|
}, []); // Run only on component mount
|
||||||
|
|
||||||
// Trigger search when debouncedQuery changes
|
// Trigger search when debouncedQuery changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
handleSearch(debouncedQuery); // Perform the search with debouncedQuery
|
handleSearch(debouncedQuery); // Perform the search with debouncedQuery
|
||||||
console.log("Performing search with debouncedQuery:", debouncedQuery);
|
console.log("Performing search with debouncedQuery:", debouncedQuery);
|
||||||
}
|
}
|
||||||
}, [debouncedQuery, initialized]); // Add initialized here
|
}, [debouncedQuery, initialized]); // Add initialized here
|
||||||
|
|
||||||
// Trigger search when filters change
|
// Trigger search when filters change
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
handleSearch(debouncedQuery); // Perform the search with the current query and filters
|
handleSearch(debouncedQuery); // Perform the search with the current query and filters
|
||||||
console.log("Performing search with updated filters:", filter);
|
console.log("Performing search with updated filters:", filter);
|
||||||
}
|
}
|
||||||
}, [filter, initialized]); // Add initialized here
|
}, [filter, initialized]); // Add initialized here
|
||||||
|
|
||||||
@@ -114,15 +115,15 @@ function App() {
|
|||||||
if (filter.class) end += `&c=${filter.class}`;
|
if (filter.class) end += `&c=${filter.class}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("Fetching search results for query:", queryToSearch);
|
console.log("Fetching search results for query:", queryToSearch);
|
||||||
const response = await fetch(`${server}/search/?q=${queryToSearch || ""}${end}`);
|
const response = await fetch(`${server}/search/?q=${queryToSearch || ""}${end}`);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setQuerying(false);
|
setQuerying(false);
|
||||||
setSyllabi(data);
|
setSyllabi(data);
|
||||||
console.log("Search results:", data);
|
console.log("Search results:", data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching search results:", error);
|
console.error("Error fetching search results:", error);
|
||||||
setQuerying(false);
|
setQuerying(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -303,8 +304,14 @@ function App() {
|
|||||||
</div>}
|
</div>}
|
||||||
<div className="p-2 shadow-2xl rounded-md flex bg-orange-500 flex-col gap-1 border">
|
<div className="p-2 shadow-2xl rounded-md flex bg-orange-500 flex-col gap-1 border">
|
||||||
<text className=" text-red-100">jfk college success club event:</text>
|
<text className=" text-red-100">jfk college success club event:</text>
|
||||||
<img className="p-2 shadow-md bg-white rounded-md border" src="/advertisement.png"/>
|
<img className="p-2 shadow-md bg-white rounded-md border" src="/advertisement.png" />
|
||||||
</div>
|
</div>
|
||||||
|
<Adsense
|
||||||
|
client="ca-pub-1666992508674643"
|
||||||
|
slot="9572064228"
|
||||||
|
format="auto"
|
||||||
|
className="h-full"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user