diff --git a/DineDevineUI/src/App.tsx b/DineDevineUI/src/App.tsx index e6db8225..7019bb42 100644 --- a/DineDevineUI/src/App.tsx +++ b/DineDevineUI/src/App.tsx @@ -30,6 +30,7 @@ import ProfilePage from "./pages/ProfilePage"; import WaitingPage from "./pages/WaitingPage"; import OnboardingPage from "./pages/OnboardingPage"; import SelectRestaurantPage from "./pages/SelectRestaurantPage"; +import IcebreakerPage from "./pages/IcebreakerPage"; setupIonicReact(); @@ -41,6 +42,7 @@ const App: React.FC = () => ( + diff --git a/DineDevineUI/src/pages/IcebreakerPage.tsx b/DineDevineUI/src/pages/IcebreakerPage.tsx new file mode 100644 index 00000000..ee4713f7 --- /dev/null +++ b/DineDevineUI/src/pages/IcebreakerPage.tsx @@ -0,0 +1,43 @@ +import React, { useEffect, useState } from 'react'; +import { IonContent, IonHeader, IonList, IonPage, IonTitle, IonToolbar, IonItem, IonLabel } from '@ionic/react'; + +const IcebreakerPage = ({ match }) => { + const [questions, setQuestions] = useState([]); + + useEffect(() => { + const id1 = match.params.id1; + const id2 = match.params.id2; + + // Make a GET request to the API with the provided IDs + fetch(`/matches/icebreaker/${id1}/${id2}`) + .then((response) => response.json()) + .then((data) => { + setQuestions(data.questions); // Assuming the API response is an object with a "questions" property + }) + .catch((error) => { + console.error('Error fetching data:', error); + }); + }, [match.params.id1, match.params.id2]); + + return ( + + + + Match Questions + + + + + + {questions.map((question, index) => ( + + {question} + + ))} + + + + ); +}; + +export default IcebreakerPage; diff --git a/DineDevineUI/src/pages/MatchPage.tsx b/DineDevineUI/src/pages/MatchPage.tsx index f2c6fd4a..b51e9b6e 100644 --- a/DineDevineUI/src/pages/MatchPage.tsx +++ b/DineDevineUI/src/pages/MatchPage.tsx @@ -1,8 +1,8 @@ import React, {useEffect, useState} from 'react'; import { IonButton, IonButtons, IonModal, - IonContent, IonDatetime, IonDatetimeButton, - IonHeader, IonIcon, + IonContent, IonDatetime, IonDatetimeButton, IonSelectOption, + IonHeader, IonIcon, IonSelect, IonPage, IonTitle, IonToolbar, @@ -67,7 +67,12 @@ const MatchPage: React.FC = (props: RouteComponentProps) => - {numberOfPeople} + + 2 + 3 + 4 + 5 +
diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..d3494333 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "DineDevine", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}