Skip to content

Commit

Permalink
removed react fc on components
Browse files Browse the repository at this point in the history
  • Loading branch information
OchiengPaul442 committed Feb 28, 2025
1 parent c163d19 commit ac280dd
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 14 deletions.
6 changes: 1 addition & 5 deletions src/website2/src/views/cleanairforum/BannerSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import { CustomButton } from '@/components/ui';

import TabNavigation from './TabNavigation';

type BannerSectionProps = {
data: any; // Type it accordingly
};

const BannerSection: React.FC<BannerSectionProps> = ({ data }) => {
const BannerSection = ({ data }: { data: any }) => {
if (!data) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/website2/src/views/cleanairforum/about/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SectionRow: React.FC<SectionRowProps> = ({ title, children }) => (
</>
);

const AboutPage: React.FC = () => {
const AboutPage = () => {
const { selectedEvent } = useForumData();

if (!selectedEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { isValidGlossaryContent } from '@/utils/glossaryValidator';
import { renderContent } from '@/utils/quillUtils';
import SectionDisplay from '@/views/cleanAirForum/SectionDisplay';

const GlossaryPage: React.FC = () => {
const GlossaryPage = () => {
// Access data from the context.
const { selectedEvent, eventTitles } = useForumData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isValidHTMLContent } from '@/utils/htmlValidator';
import { renderContent } from '@/utils/quillUtils';
import SectionDisplay from '@/views/cleanAirForum/SectionDisplay';

const LogisticsPage: React.FC = () => {
const LogisticsPage = () => {
// Destructure the selected event from the context.
const { selectedEvent } = useForumData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { renderContent } from '@/utils/quillUtils';
import SectionDisplay from '@/views/cleanAirForum/SectionDisplay';
import PaginatedSection from '@/views/cleanAirNetwork/PaginatedSection';

const PartnersPage: React.FC = () => {
const PartnersPage = () => {
const { selectedEvent } = useForumData();
if (!selectedEvent) return null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isValidHTMLContent } from '@/utils/htmlValidator';
import { renderContent } from '@/utils/quillUtils';
import SectionDisplay from '@/views/cleanAirForum/SectionDisplay';

const CommitteePage: React.FC = () => {
const CommitteePage = () => {
// Always call useForumData to get the selectedEvent.
const { selectedEvent } = useForumData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const AccordionItem = ({ session, isOpen, toggleAccordion }: any) => {
);
};

const ResourcesPage: React.FC = () => {
const ResourcesPage = () => {
const { selectedEvent } = useForumData();
const [openAccordions, setOpenAccordions] = useState<{
[resourceIndex: number]: { [sessionIndex: number]: boolean };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const AccordionItem: React.FC<AccordionItemProps> = ({
);
};

const ProgramsPage: React.FC = () => {
const ProgramsPage = () => {
const { selectedEvent } = useForumData();
const [openAccordion, setOpenAccordion] = useState<string | null>(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isValidHTMLContent } from '@/utils/htmlValidator';
import { renderContent } from '@/utils/quillUtils';
import SectionDisplay from '@/views/cleanAirForum/SectionDisplay';

const SpeakersPage: React.FC = () => {
const SpeakersPage = () => {
// Now we use the selectedEvent from context
const { selectedEvent } = useForumData();
const membersPerPage = 6;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { renderContent } from '@/utils/quillUtils';
import SectionDisplay from '@/views/cleanAirForum/SectionDisplay';
import PaginatedSection from '@/views/cleanAirNetwork/PaginatedSection';

const SponsorshipPage: React.FC = () => {
const SponsorshipPage = () => {
const { selectedEvent } = useForumData();
if (!selectedEvent) return null;

Expand Down

0 comments on commit ac280dd

Please sign in to comment.