From 1fdbb2b3cacad6152f2731fa7a787cd4c6a6fa65 Mon Sep 17 00:00:00 2001 From: swve Date: Sun, 2 Mar 2025 12:19:28 +0100 Subject: [PATCH] feat: init Hero, TextImage, Logos, People Landing sections --- .../Org/OrgEditLanding/OrgEditLanding.tsx | 120 ++++++++++++++---- .../Pages/Org/OrgEditLanding/landing_types.ts | 1 + .../web/components/Landings/LandingCustom.tsx | 102 ++++++++------- 3 files changed, 158 insertions(+), 65 deletions(-) diff --git a/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx b/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx index 33b27dd6..b218fa49 100644 --- a/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx +++ b/apps/web/components/Dashboard/Pages/Org/OrgEditLanding/OrgEditLanding.tsx @@ -52,16 +52,56 @@ const PREDEFINED_GRADIENTS = { colors: ['#f0fff4', '#dcfce7'] as Array, direction: '45deg' }, - 'lavender-mist': { - colors: ['#faf5ff', '#f3e8ff'] as Array, + 'deep-ocean': { + colors: ['#0f172a', '#1e3a8a'] as Array, + direction: '135deg' + }, + 'sunset-blaze': { + colors: ['#7f1d1d', '#ea580c'] as Array, direction: '45deg' }, - 'ocean-spray': { - colors: ['#f0f9ff', '#e0f2fe'] as Array, + 'midnight-purple': { + colors: ['#581c87', '#7e22ce'] as Array, + direction: '90deg' + }, + 'forest-depths': { + colors: ['#064e3b', '#059669'] as Array, + direction: '225deg' + }, + 'berry-fusion': { + colors: ['#831843', '#be185d'] as Array, + direction: '135deg' + }, + 'cosmic-night': { + colors: ['#1e1b4b', '#4338ca'] as Array, direction: '45deg' }, - 'peach-cream': { - colors: ['#fff7ed', '#ffedd5'] as Array, + 'autumn-fire': { + colors: ['#7c2d12', '#c2410c'] as Array, + direction: '90deg' + }, + 'emerald-depths': { + colors: ['#064e3b', '#10b981'] as Array, + direction: '135deg' + }, + 'royal-navy': { + colors: ['#1e3a8a', '#3b82f6'] as Array, + direction: '225deg' + }, + 'volcanic': { + colors: ['#991b1b', '#f97316'] as Array, + direction: '315deg' + }, + 'arctic-night': { + colors: ['#0f172a', '#475569'] as Array, + direction: '90deg' + }, + 'grape-punch': { + colors: ['#6b21a8', '#d946ef'] as Array, + direction: '135deg' + }, + 'marine-blue': { + colors: ['#0c4a6e', '#0ea5e9'] as Array, direction: '45deg' } } as const @@ -150,6 +190,7 @@ const OrgEditLanding = () => { case 'logos': return { type: 'logos', + title: 'New Logos Section', logos: [] } case 'people': @@ -282,38 +323,62 @@ const OrgEditLanding = () => {
setSelectedSection(index)} + className={`p-4 bg-white/80 backdrop-blur-sm rounded-lg cursor-pointer border ${ + selectedSection === index + ? 'border-blue-500 bg-blue-50 ring-2 ring-blue-500/20 shadow-sm' + : 'border-gray-200 hover:border-gray-300 hover:bg-gray-50/50 hover:shadow-sm' + } ${snapshot.isDragging ? 'shadow-lg ring-2 ring-blue-500/20 rotate-2' : ''}`} > -
+
-
+
- {React.createElement(SECTION_TYPES[section.type as keyof typeof SECTION_TYPES].icon, { - size: 16, - className: "text-gray-600" - })} - +
+ {React.createElement(SECTION_TYPES[section.type as keyof typeof SECTION_TYPES].icon, { + size: 16 + })} +
+ {getSectionDisplayName(section)}
-
+
@@ -986,6 +1051,17 @@ const LogosSectionEditor: React.FC<{
+ {/* Title */} +
+ + onChange({ ...section, title: e.target.value })} + placeholder="Enter section title" + /> +
+ {section.logos.map((logo, index) => (
-
+

{section.heading.text}

{section.subheading.text}

-
+
{section.buttons.map((button, index) => ( -
-
-

{section.title}

-

{section.text}

-
+
+ @@ -96,17 +104,23 @@ function LandingCustom({ landing, orgslug }: LandingCustomProps) { return (
-
- {section.logos.map((logo, index) => ( - {logo.alt} - ))} + {section.title && ( +

{section.title}

+ )} +
+
+ {section.logos.map((logo, index) => ( +
+ {logo.alt} +
+ ))} +
) @@ -114,19 +128,21 @@ function LandingCustom({ landing, orgslug }: LandingCustomProps) { return (
-

{section.title}

-
+

{section.title}

+
{section.people.map((person, index) => ( -
- {person.name} -

{person.name}

-

{person.description}

+
+
+ {person.name} +
+

{person.name}

+

{person.description}

))}
@@ -136,9 +152,9 @@ function LandingCustom({ landing, orgslug }: LandingCustomProps) { return (
-

{section.title}

+

{section.title}

{section.courses.map((course, index) => (
@@ -155,7 +171,7 @@ function LandingCustom({ landing, orgslug }: LandingCustomProps) { } return ( -
+
{landing.sections.map((section) => renderSection(section))}
)