Skip to content

Commit

Permalink
removed type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Ainapure committed Oct 13, 2024
1 parent 01d25b9 commit ec04bf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion frontend/src/appComponents/ClubAdmin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { motion } from "framer-motion";
import { cn } from "@/lib/utils";
import { useAuth } from "../context/AuthContext";
import { Routes, Route } from "react-router-dom";
import Events from "./Events";
import QuizCreation from "./QuizCreation";
import AdminResults from "./AdminResults";
import EventCreation from "./EventCreation";
Expand Down
10 changes: 4 additions & 6 deletions frontend/src/appComponents/ViewEvent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useNavigate, useParams,useHistory } from 'react-router-dom';
import { useNavigate, useParams } from 'react-router-dom';
import { useState, useEffect } from 'react';
import axiosInstance from './axiosInstance';

Expand All @@ -7,9 +7,8 @@ import axiosInstance from './axiosInstance';
const ViewEvent = () => {
const { id } = useParams<{ id: string }>();
const [eventData, setEventData] = useState<any>(null);
const history = useHistory();

// const navigate = useNavigate();
const navigate = useNavigate();
useEffect(() => {
const fetchEventData = async () => {
try {
Expand All @@ -28,9 +27,8 @@ const ViewEvent = () => {
if (eventData === null) return <div>Loading...</div>
return (
<div className='rounded-tl-2xl p-2 w-full min-h-screen bg-emerald-500'>
<button onClick={()=>{
// navigate('/clubAdmin/events')
history.push('/clubAdmin/events');
<button onClick={() => {
navigate('/clubAdmin/events')
}} className='absolute top-6 right-8 p-2 bg-white text-black font-semibold rounded-md block'>{"<-- Back"}</button>

ViewEvent
Expand Down

0 comments on commit ec04bf1

Please sign in to comment.