Skip to content

Commit

Permalink
added simple condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyshnav001 committed Nov 14, 2023
1 parent 87a9e0c commit 779c25a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Events/events.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Loading from "../Loading/Loading.jsx";

const EventPage = () => {
const { newEvents, setNewEvents } = useContext(MainContext);

const [upComingEvent, setUpComingEvent] = useState([{}]);
const [loading,setLoading] = useState(false)

Expand All @@ -31,7 +30,7 @@ const EventPage = () => {
};

const getEventData = async()=>{
await axios
await axios
.get("http://localhost:3000/getevents")
.then((events) => setEvents(events.data))
.catch((err) => console.log(err));
Expand Down Expand Up @@ -154,7 +153,7 @@ const EventPage = () => {
</div>
<div className="grid grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-4 sm:gap-6 md:gap-8 mx-auto">
{loading ? "" :<Loading/>}
{events.map((member, index) => (
{events?.map((member, index) => (
<div
className="mr-4 sm:justify-center md:justify-start lg:justify-start xl:justify-start"
key={index}
Expand Down

0 comments on commit 779c25a

Please sign in to comment.