diff --git a/frontend/sportsmatch-app/src/components/HostEventComponent.tsx b/frontend/sportsmatch-app/src/components/HostEventComponent.tsx index 65da1f7..81717ac 100644 --- a/frontend/sportsmatch-app/src/components/HostEventComponent.tsx +++ b/frontend/sportsmatch-app/src/components/HostEventComponent.tsx @@ -9,8 +9,6 @@ import { HostEventDTO, EventDTO, ApiError, - OpenAPI, - ExSecuredEndpointService, } from '../generated/api' import DatePicker from 'react-datepicker' import 'react-datepicker/dist/react-datepicker.css' @@ -44,8 +42,6 @@ function HostEventComponent() { const [nearbyEvents, setNearbyEvents] = useState([]) const [selectedEvent, setSelectedEvent] = useState() const { isOpen, toggle } = useModal() - const [usersRank, setUsersRank] = useState(0) - const [userIsInRank, setUserIsInRank] = useState(false) const [searchQuery, setSearchQuery] = useState('') // no implementation yet console.log(searchQuery) @@ -136,35 +132,13 @@ function HostEventComponent() { // handle join event pop up after cliking on the event const handleEventSelection = (e: EventDTO) => { - window.scrollTo(0, 0) if (isOpen) { toggle() } setSelectedEvent(e) - if (usersRank >= e.minElo && usersRank <= e.maxElo) { - setUserIsInRank(true) - } else { - setUserIsInRank(false) - } toggle() } - // retrieving users rank - useEffect(() => { - const fetchUsersRank = async () => { - OpenAPI.TOKEN = localStorage.getItem('token')! - try { - const response = await ExSecuredEndpointService.getUserMainPage() - if (response) { - setUsersRank(response.elo) - } - } catch (error) { - console.error(error as ApiError) - } - } - fetchUsersRank() - }) - return ( <>
@@ -295,11 +269,7 @@ function HostEventComponent() {
- +