From a8c1514bc61194391bda183847338db2ff8dc82a Mon Sep 17 00:00:00 2001 From: adambelouad <132090786+adambelouad@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:34:05 -0400 Subject: [PATCH 1/2] added study group data integration --- frontend/app/study-groups/page.tsx | 87 +++++++++++++----------------- 1 file changed, 36 insertions(+), 51 deletions(-) diff --git a/frontend/app/study-groups/page.tsx b/frontend/app/study-groups/page.tsx index 6baa738..2a81df7 100644 --- a/frontend/app/study-groups/page.tsx +++ b/frontend/app/study-groups/page.tsx @@ -12,81 +12,66 @@ 'use client'; -import type { ChangeEvent } from 'react'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; -import { Button, Heading, Pane, Text, TextInputField, majorScale, useTheme } from 'evergreen-ui'; +import { Button, Heading, Pane, Text, majorScale, useTheme } from 'evergreen-ui'; import Link from 'next/link'; -/** - * A React component that renders a form for user interaction, allowing users to input their name - * and select an option from a dropdown menu. It uses Evergreen UI components for styling and - * integrates with Auth0 for user authentication. The form submission triggers an async action that - * simulates an API call and provides feedback through toast notifications. - * - * @returns {JSX.Element} The form component with user interaction elements. - */ +import { getAllStudyGroup } from '@/api/studyGroupService'; +import StudyGroupCard from '@/components/StudyGroupCard/StudyGroupCard'; + export function StudyGroups() { - /** - * Handles the input field which can perform queries - */ const theme = useTheme(); - const [inputValue, setInputValue] = useState(''); - const handleChange = (e: ChangeEvent) => { - setInputValue(e.target.value); - }; + const [studyGroups, setStudyGroups] = useState>>(null); - /** - * Handles the button click - */ - const handleSubmit = () => { - // Placeholder for button click action - }; + useEffect(() => { + getAllStudyGroup().then(setStudyGroups); + }, []); return ( - {/* Main header */} - + Study Groups - {/* Subtitle */} - - Find classmates and form study groups - - - + Find classmates and form study groups - - + + - + + - - - - - + + {studyGroups === null ? ( + Loading study groups... + ) : studyGroups.length === 0 ? ( + No study groups found. + ) : ( + studyGroups.map((group) => ( + {}} + /> + )) + )} ); From 81edfc0802907c59a6505628ba2640607ae66307 Mon Sep 17 00:00:00 2001 From: adambelouad <132090786+adambelouad@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:45:59 -0400 Subject: [PATCH 2/2] fixed prettier issues --- frontend/app/study-groups/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/app/study-groups/page.tsx b/frontend/app/study-groups/page.tsx index 2a81df7..599eaa1 100644 --- a/frontend/app/study-groups/page.tsx +++ b/frontend/app/study-groups/page.tsx @@ -22,7 +22,8 @@ import StudyGroupCard from '@/components/StudyGroupCard/StudyGroupCard'; export function StudyGroups() { const theme = useTheme(); - const [studyGroups, setStudyGroups] = useState>>(null); + const [studyGroups, setStudyGroups] = + useState>>(null); useEffect(() => { getAllStudyGroup().then(setStudyGroups);