Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
OchiengPaul442 committed Feb 13, 2025
1 parent b01336f commit ffff126
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
1 change: 0 additions & 1 deletion website2/src/app/clean-air-forum/sponsorships/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const SponsorshipPage = () => {
{/* Additional Section Data for Sponsorship Page */}
{sponsorshipSections && sponsorshipSections.length > 0 && (
<>
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
{sponsorshipSections.map((section: any) => (
<SectionDisplay key={section.id} section={section} />
))}
Expand Down
36 changes: 20 additions & 16 deletions website2/src/views/Forum/SectionDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import DOMPurify from 'dompurify';
import React from 'react';

import Divider from '@/components/ui/Divider';
import { renderContent } from '@/utils/quillUtils';

export interface SectionData {
Expand Down Expand Up @@ -35,23 +36,26 @@ const SectionDisplay: React.FC<{ section: SectionData }> = ({ section }) => {

if (section.section_type === 'split') {
return (
<div className="flex flex-col md:flex-row gap-4 my-8">
{/*
For split sections, we use conditional order classes.
- If reverse_order is false: title is first (left) and content second (right).
- If reverse_order is true: content is first (left) and title second (right).
*/}
<div
className={`w-full md:w-1/2 ${section.reverse_order ? 'order-2' : 'order-1'}`}
>
<h2 className="text-2xl font-bold">{section.title}</h2>
</div>
<div
className={`w-full md:w-1/2 ${section.reverse_order ? 'order-1' : 'order-2'}`}
>
<div dangerouslySetInnerHTML={{ __html: contentHTML }} />
<>
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
<div className="flex flex-col md:flex-row gap-4 my-8">
{/*
For split sections, we use conditional order classes.
- If reverse_order is false: title is first (left) and content second (right).
- If reverse_order is true: content is first (left) and title second (right).
*/}
<div
className={`w-full md:w-1/3 ${section.reverse_order ? 'order-2' : 'order-1'}`}
>
<h2 className="text-xl font-bold">{section.title}</h2>
</div>
<div
className={`w-full md:w-2/3 text-left space-y-4 ${section.reverse_order ? 'order-1' : 'order-2'}`}
>
<div dangerouslySetInnerHTML={{ __html: contentHTML }} />
</div>
</div>
</div>
</>
);
} else {
// For "column" type, render the title above the content with a small gap.
Expand Down

0 comments on commit ffff126

Please sign in to comment.