diff --git a/src/App.js b/src/App.js
index ebb0575..cbd7a1f 100644
--- a/src/App.js
+++ b/src/App.js
@@ -6,6 +6,7 @@ import Home from './pages/Home';
import TeamResults from './pages/TeamResult';
import Home2 from './pages/Home2';
import GameList from './pages/GameList';
+import Faq from './pages/Faq';
// Auth Context
const AuthContext = React.createContext();
@@ -1059,8 +1060,10 @@ const App = () => {
}
/>
} />
- } />
+ } />
} />
+ } />
+
diff --git a/src/pages/Faq.js b/src/pages/Faq.js
new file mode 100644
index 0000000..7ca2ae3
--- /dev/null
+++ b/src/pages/Faq.js
@@ -0,0 +1,74 @@
+import React from 'react';
+import { useState } from 'react';
+import Header from './Header';
+
+ const Faq = () => {
+ const [openIndex, setOpenIndex] = useState(null);
+
+ const toggleFAQ = (index) => {
+ setOpenIndex(openIndex === index ? null : index);
+ };
+
+ const faqs = [
+ { question: "HOW TO PLAY", answer: "Details about how to play." },
+ { question: "WHERE TO PLAY", answer: "Information on where to play." },
+ { question: "WINNING NUMBERS EMAIL", answer: "Sign up for emails." },
+ ];
+
+ return (
+ <>
+
+
+ {/* FAQ Section */}
+
+ {faqs.map((faq, index) => (
+
+
+ {openIndex === index && (
+
+ {faq.answer}
+
+ )}
+
+ ))}
+
+
+ {/* Footer Section */}
+
+
+
+ >
+ );
+ }
+
+ export default Faq;
+
\ No newline at end of file
diff --git a/src/pages/Footer.js b/src/pages/Footer.js
new file mode 100644
index 0000000..659eac4
--- /dev/null
+++ b/src/pages/Footer.js
@@ -0,0 +1,41 @@
+import React from 'react';
+import Faq from './Faq';
+const Footer = () => {
+
+ return (
+ <>
+
+ {/* FAQ Section */}
+
+
+ {/* Footer Section */}
+
+
+ >
+ );
+}
+
+export default Footer;
diff --git a/src/pages/GameList.js b/src/pages/GameList.js
index 9a46dd2..6499a65 100644
--- a/src/pages/GameList.js
+++ b/src/pages/GameList.js
@@ -3,6 +3,8 @@ import { BarChart2, Calendar, RefreshCw, Clock, ChevronLeft, ChevronRight } from
import axios from 'axios';
import TodaysMatch from './TodaysMatch';
import Today from './Today';
+import Header from './Header';
+import Footer from './Footer';
const GameList = () => {
const [teams, setTeams] = useState([]);
@@ -141,33 +143,41 @@ const GameList = () => {
}, []);
// Show chart for selected team
- const handleViewChart = async (team) => {
- try {
- setLoading(true);
- // Get monthly results for the selected team
- const currentDate = new Date();
- const month = currentDate.getMonth() + 1;
- const year = currentDate.getFullYear();
-
- const response = await axios.post(`${API_URL}/results/monthly`, {
- team: team.name,
- month: `${year}-${month.toString().padStart(2, '0')}`
- });
-
- setSelectedTeam({
- ...team,
- chartData: response.data
- });
-
- setShowChartView(true);
- setShowCalendar(false);
- setLoading(false);
- } catch (err) {
- console.error("Error fetching chart data:", err);
- setError("Failed to load chart data. Please try again later.");
- setLoading(false);
- }
- };
+const handleViewChart = async (team) => {
+ try {
+ setLoading(true);
+ // Get monthly results for the selected team
+ const currentDate = new Date();
+ const month = currentDate.getMonth() + 1;
+ const year = currentDate.getFullYear();
+
+ const monthStr = `${year}-${month.toString().padStart(2, '0')}`;
+
+ console.log("Fetching chart data for:", team.name, "Month:", monthStr);
+
+ const response = await axios.post(`${API_URL}/results/monthly`, {
+ team: team.name,
+ month: monthStr
+ });
+
+ console.log("API Response:", response.data);
+
+ // Keep the original data structure
+ setSelectedTeam({
+ ...team,
+ chartData: response.data
+ });
+
+ setShowChartView(true);
+ setShowCalendar(false);
+ setLoading(false);
+ } catch (err) {
+ console.error("Error fetching chart data:", err);
+ setError("Failed to load chart data: " + (err.response?.data?.message || err.message));
+ setLoading(false);
+ setShowChartView(false);
+ }
+};
// Load calendar data
const loadCalendarData = async (year, month) => {
@@ -288,21 +298,9 @@ const GameList = () => {
});
};
-
- const [openIndex, setOpenIndex] = useState(null);
-
- const toggleFAQ = (index) => {
- setOpenIndex(openIndex === index ? null : index);
- };
-
- const faqs = [
- { question: "HOW TO PLAY", answer: "Details about how to play." },
- { question: "WHERE TO PLAY", answer: "Information on where to play." },
- { question: "WINNING NUMBERS EMAIL", answer: "Sign up for emails." },
- ];
-
return (
+
@@ -322,14 +320,14 @@ const GameList = () => {
Latest Results
-
+ */}