Skip to content

Commit

Permalink
Merge pull request #21 from she-code-africa/fix-leak
Browse files Browse the repository at this point in the history
Fix leak
  • Loading branch information
EseAlli authored Jul 27, 2024
2 parents 08d85b5 + d8c2d5e commit bbf6836
Show file tree
Hide file tree
Showing 24 changed files with 1,075 additions and 421 deletions.
488 changes: 488 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
"react-scripts": "5.0.1",
"react-slick": "^0.30.2",
"react-toastify": "^10.0.5",
"serve": "^14.2.3",
"slick-carousel": "^1.8.1",
"web-vitals": "^2.1.4",
"yup": "^1.4.0"
},
"scripts": {
"start": "react-scripts start",
"start": "serve -s build",
"dev": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
Expand Down
Binary file removed src/assets/images/activities/cardPhoto.png
Binary file not shown.
Binary file removed src/assets/images/activities/cardPhoto2.png
Binary file not shown.
Binary file removed src/assets/images/activities/cardPhoto3.png
Binary file not shown.
Binary file removed src/assets/images/activities/cardPhoto4.png
Binary file not shown.
Binary file removed src/assets/images/activities/cardPhoto5.png
Binary file not shown.
Binary file removed src/assets/images/activities/cardPhoto6.png
Binary file not shown.
12 changes: 0 additions & 12 deletions src/assets/images/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import scaLogo from "./SCA-LOGO.png";
import cpu from "./activities/Cpu.png";
import codingHeroImage from "./activities/codingHeroImage.png";
import flower from "./activities/Group.png";
import cardPhoto from "./activities/cardPhoto.png";
import cardPhoto2 from "./activities/cardPhoto2.png";
import cardPhoto3 from "./activities/cardPhoto3.png";
import cardPhoto4 from "./activities/cardPhoto4.png";
import cardPhoto5 from "./activities/cardPhoto5.png";
import cardPhoto6 from "./activities/cardPhoto6.png";
import upcomingEventPhoto from "./activities/eventsPhoto.png";
import girlChild from "./activities/girlChild.png";
import quotes from "./activities/Quotes.png";
Expand All @@ -29,12 +23,6 @@ export {
cpu,
codingHeroImage,
flower,
cardPhoto,
cardPhoto2,
cardPhoto3,
cardPhoto4,
cardPhoto5,
cardPhoto6,
upcomingEventPhoto,
girlChild,
quotes,
Expand Down
1 change: 1 addition & 0 deletions src/components/Recaptcha.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useEffect, useRef } from "react";

function GoogleRecaptcha({ onToken }) {
Expand Down
9 changes: 7 additions & 2 deletions src/components/activities/UpcomingEvents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const UpcomingEvents = ({ activityTitle }) => {
queryFn: () => getActivityEvents(activityId),
enabled: !!activityId && !isLoading,
});

const filteredEvents =
activityData &&
activityData.length > 0 &&
activityData.filter((event) => event.state === "published");
return (
<>
<InfoCardHeader
Expand All @@ -39,10 +44,10 @@ const UpcomingEvents = ({ activityTitle }) => {

{isEventLoading ? (
<ApiLoading />
) : !!activityData && activityData.length > 0 ? (
) : filteredEvents && filteredEvents.length > 0 ? (
<EventsSlider
settings={upcomingEventSettings}
sliderData={activityData}
sliderData={filteredEvents}
imageH="h-[403px]"
/>
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { quotes } from "../../../assets/images";
import Slider from "react-slick";
// import { testimonialSliderContent } from "../../../utils/appData";
import { FaArrowLeftLong, FaArrowRightLong } from "react-icons/fa6";
import { useQuery } from "@tanstack/react-query";
import { getAllTestimonials } from "../../../services/queries";
Expand Down
11 changes: 2 additions & 9 deletions src/components/activities/coding-page/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ import {
InfoCard,
} from "../../shared-components";
import { codingHeroImage } from "../../../assets/images";
// import { coursesSlider } from "../../../utils/appData";
import UpcomingEvents from "../UpcomingEvents";
import ReadyToCode from "../ReadyToCode";

import { useQuery } from "@tanstack/react-query";
import {
getActivityCourses,
getAllActivities,
} from "../../../services/queries";
import { ApiLoading, EmptyResponse } from "../../index";
import { codingHeroSubContent } from "../../../utils/appData";
// import useInfiniteScroll from "react-easy-infinite-scroll-hook";
import InfiniteScroll from "react-infinite-scroll-component";
// import InfoCard from "../../shared-components/activities/info-card/InfoCard";

const CodingPageComponent = () => {
const {
Expand Down Expand Up @@ -94,11 +90,10 @@ const CodingPageComponent = () => {
<UpcomingEvents activityTitle="coding" />
</div> */}
</section>
<section>
</section>
<section></section>
<section>
<div className=" w-[100%] ">
<ReadyToCode />
<ReadyToCode />
</div>
</section>
<section className="w-[90%] max-w-[1280px] mx-auto ">
Expand Down Expand Up @@ -129,8 +124,6 @@ const CodingPageComponent = () => {
title={item.title}
cardImage={item.image}
paragraph={item.description}
index={item.index}
// imageH={imageH}
link={item.link}
/>
))}
Expand Down
3 changes: 0 additions & 3 deletions src/components/activities/game-development/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from "../../shared-components";
import InfiniteScroll from "react-infinite-scroll-component";
import { gameDevHeroImage } from "../../../assets/images";
// import { coursesSlider } from "../../../utils/appData";
import UpcomingEvents from "../UpcomingEvents";
import { useQuery } from "@tanstack/react-query";
import {
Expand Down Expand Up @@ -104,8 +103,6 @@ const GameDevelopmentPage = () => {
title={item.title}
cardImage={item.image}
paragraph={item.description}
index={item.index}
// imageH={imageH}
link={item.link}
/>
))}
Expand Down
5 changes: 0 additions & 5 deletions src/components/activities/robotics/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from "../../shared-components";
import InfiniteScroll from "react-infinite-scroll-component";
import { roboticsHeroImage } from "../../../assets/images";
// import { coursesSlider } from "../../../utils/appData";
import UpcomingEvents from "../UpcomingEvents";

import { useQuery } from "@tanstack/react-query";
Expand Down Expand Up @@ -46,8 +45,6 @@ const RoboticsPageComponent = () => {
enabled: !!activityId && !isLoading,
});

console.log({ activityCourses });

// inifinite scrolling
const filteredCourses =
activityCourses &&
Expand Down Expand Up @@ -110,8 +107,6 @@ const RoboticsPageComponent = () => {
title={item.title}
cardImage={item.image}
paragraph={item.description}
index={item.index}
// imageH={imageH}
link={item.link}
/>
))}
Expand Down
7 changes: 0 additions & 7 deletions src/components/error/ErrorComponent.jsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/components/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import CodingPageComponent from "./activities/coding-page";
import RoboticsPageComponent from "./activities/robotics";
import GameDevelopmentPage from "./activities/game-development";
import ApiLoading from "./loaders/ApiLoading";
import ErrorComponent from "./error/ErrorComponent";
import EmptyResponse from "./empty-repsonse";
import ContactUsComponent from "./contact-us";
import PrimaryInput from "./inputs/PrimaryInput";
Expand All @@ -14,7 +13,6 @@ export {
RoboticsPageComponent,
GameDevelopmentPage,
ApiLoading,
ErrorComponent,
EmptyResponse,
ContactUsComponent,
PrimaryInput,
Expand Down
2 changes: 1 addition & 1 deletion src/components/modals/NewsLetter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const NewsLetter = ({ setShowNewsLetterModal }) => {
} = useForm({
resolver: yupResolver(schema),
});
const onsubmit = (data) => console.log(data);
const onsubmit = (data) => console.log("submitted form");
return (
<section className="fixed bg-[rgba(0,0,0,0.5)] top-0 bottom-0 left-0 right-0 z-[3] flex items-center justify-center py-5">
<div className="bg-white max-w-[500px] w-[90%] mx-auto py-4 px-4">
Expand Down
4 changes: 2 additions & 2 deletions src/components/navbar/MenuLinks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MenuLinks = ({ menuItem, isOpen, onToggle }) => {
{menuItem.isDropdown ? (
<li className={`text-base font-medium cursor-pointer relative `}>
<span
className={`flex gap-1 items-center ${
className={`flex gap-1 items-center hover:text-primaryPink ${
pathname.includes(menuItem.pathname.toLowerCase()) &&
"text-primaryPink font-bold"
}`}
Expand Down Expand Up @@ -47,7 +47,7 @@ const MenuLinks = ({ menuItem, isOpen, onToggle }) => {
</li>
) : (
<li
className={`text-base font-medium ${
className={`text-base font-medium hover:text-primaryPink ${
pathname === menuItem.path && "text-primaryPink font-bold"
}`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Link } from "react-router-dom";
import { FaAngleRight } from "react-icons/fa6";

const InfoCard = ({
index,
title,
paragraph,
cardImage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const InfoCardSlider = ({ sliderData, imageH, settings }) => {
title={item.title}
cardImage={item.image}
paragraph={item.description}
index={item.index}
imageH={imageH}
link={item.link}
/>
Expand Down
1 change: 0 additions & 1 deletion src/pages/stem-clubs/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import ActivitiesSection from "../../components/shared-components/activities/act
// import Schools from "../../components/schools";
import { InfoCardHeader } from "../../components/shared-components";
import ImpactStoryCard from "../../components/cards/impact-stories-card";
// import { impactStories } from "../../utils/appData";
import { clubStudentsImage, floralWhiteImage } from "../../assets/images";
import { useQuery } from "@tanstack/react-query";
import { getAllImpactStories } from "../../services/queries";
Expand Down
Loading

0 comments on commit bbf6836

Please sign in to comment.