diff --git a/app/(landing)/organizations/[id]/grants/page.tsx b/app/(landing)/organizations/[id]/grants/page.tsx index 73a2f4afe..a3c4a10d8 100644 --- a/app/(landing)/organizations/[id]/grants/page.tsx +++ b/app/(landing)/organizations/[id]/grants/page.tsx @@ -1,18 +1,7 @@ -'use client'; - -import { useParams } from 'next/navigation'; -import OrganizationHeader from '@/components/organization/OrganizationHeader'; -import OrganizationSidebar from '@/components/organization/OrganizationSidebar'; - export default function GrantsPage() { - const params = useParams(); - const organizationId = params.id as string; - return (
-
-

Grants

Manage your grants here

diff --git a/app/(landing)/organizations/[id]/hackathons/page.tsx b/app/(landing)/organizations/[id]/hackathons/page.tsx index 2a818a041..9d6156b4a 100644 --- a/app/(landing)/organizations/[id]/hackathons/page.tsx +++ b/app/(landing)/organizations/[id]/hackathons/page.tsx @@ -1,18 +1,9 @@ 'use client'; -import { useParams } from 'next/navigation'; -import OrganizationHeader from '@/components/organization/OrganizationHeader'; -import OrganizationSidebar from '@/components/organization/OrganizationSidebar'; - export default function HackathonsPage() { - const params = useParams(); - const organizationId = params.id as string; - return (
-
-

Hackathons

Manage your hackathons here

diff --git a/app/(landing)/organizations/[id]/settings/page.tsx b/app/(landing)/organizations/[id]/settings/page.tsx index 64813fbab..b37c5143c 100644 --- a/app/(landing)/organizations/[id]/settings/page.tsx +++ b/app/(landing)/organizations/[id]/settings/page.tsx @@ -1,17 +1,14 @@ 'use client'; import { useParams } from 'next/navigation'; -import OrganizationHeader from '@/components/organization/OrganizationHeader'; -import OrganizationSidebar from '@/components/organization/OrganizationSidebar'; import OrganizationSettings from '@/components/organization/OrganizationSettings'; export default function OrganizationSettingsPage() { const params = useParams(); const organizationId = params.id as string; - // TODO: Fetch organization data based on ID const mockOrgData = { - name: 'Tech Innovators Hub', + name: 'Boundless', logo: '/tech-company-logo.jpg', tagline: 'Building the future of technology', about: 'We are a community of innovators...', @@ -19,9 +16,7 @@ export default function OrganizationSettingsPage() { return (
-
- 4 && pathname !== '/dashboard/organizations'); + pathname !== '/organizations' && pathname.startsWith('/organizations'); + + const getOrgIdFromPath = () => { + if (pathname.startsWith('/organizations/')) { + const pathParts = pathname.split('/'); + const orgId = pathParts[2]; + if (orgId && /^[a-f0-9]{24}$/.test(orgId)) { + return orgId; + } + } + return null; + }; + + const initialOrgId = getOrgIdFromPath(); return ( -
- - {showSidebar ? ( -
- -
{children}
-
- ) : ( -
{children}
- )} -
+ +
+ + {showSidebar ? ( +
+ +
{children}
+
+ ) : ( +
{children}
+ )} +
+
); } diff --git a/app/globals.css b/app/globals.css index 26299f5f1..f72c10d86 100644 --- a/app/globals.css +++ b/app/globals.css @@ -57,8 +57,9 @@ --color-success-900: #004617; --color-active-bg: rgba(167, 249, 80, 0.08); + --color-active-bg2: rgba(167, 249, 80, 0.32); } -/* Custom scrollbar styles for comment modal */ + .custom-scrollbar { scrollbar-width: thin; scrollbar-color: #4a4a4a #1a1a1a; diff --git a/components/organization/OrganizationContent.tsx b/components/organization/OrganizationContent.tsx index e1ae5a745..6136e65d7 100644 --- a/components/organization/OrganizationContent.tsx +++ b/components/organization/OrganizationContent.tsx @@ -5,48 +5,14 @@ import { Input } from '@/components/ui/input'; import OrganizationCard from './cards/OrganzationCards'; import Link from 'next/link'; import { BoundlessButton } from '../buttons'; - -const mockOrganizations = [ - { - id: '1', - name: 'Tech Innovators Hub', - logo: '/organization-logo.svg', - createdAt: '2 days ago', - hackathons: { count: 3, submissions: 1 }, - grants: { count: 7, applications: 3 }, - }, - { - id: '2', - name: 'Green Energy Initiative', - logo: '/organization-logo.svg', - createdAt: '1 week ago', - hackathons: { count: 5, submissions: 2 }, - grants: { count: 12, applications: 8 }, - }, - { - id: '3', - name: 'AI Research Collective', - logo: '/organization-logo.svg', - createdAt: '3 weeks ago', - hackathons: { count: 8, submissions: 5 }, - grants: { count: 15, applications: 10 }, - }, - { - id: '4', - name: 'Community Builders Network', - logo: '/organization-logo.svg', - createdAt: '1 month ago', - hackathons: { count: 2, submissions: 0 }, - grants: { count: 4, applications: 2 }, - }, -]; +import { useOrganization } from '@/lib/providers/OrganizationProvider'; export default function OrganizationContent() { - const hasorganizations = mockOrganizations.length > 0; + const { organizations } = useOrganization(); + const hasOrganizations = organizations.length > 0; return (
- {/* Search and Sort Bar */} - {hasorganizations && ( + {hasOrganizations && (
@@ -64,7 +30,7 @@ export default function OrganizationContent() { Sort - {hasorganizations && ( + {hasOrganizations && (
- {/* Add Organization Section */} - {hasorganizations && ( + {hasOrganizations && (
- {mockOrganizations.map(org => ( - - + {organizations.map(org => ( + + ))}
)} - {!hasorganizations && ( -
+ {!hasOrganizations && ( +
- diff --git a/components/organization/OrganizationHeader.tsx b/components/organization/OrganizationHeader.tsx index 4a17dc3ef..9045fee29 100644 --- a/components/organization/OrganizationHeader.tsx +++ b/components/organization/OrganizationHeader.tsx @@ -14,16 +14,16 @@ import { useAuthActions, useAuthStatus } from '@/hooks/use-auth'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import OrganizationSelector from './cards/OrganizationSelector'; +import { useOrganization } from '@/lib/providers/OrganizationProvider'; export default function OrganizationHeader() { const { isLoading, user } = useAuthStatus(); const { logout } = useAuthActions(); const pathname = usePathname(); const isOnOrganizationsPage = pathname === '/dashboard/organizations'; - + const { organizations, activeOrg, setActiveOrg } = useOrganization(); const showOrgSelector = - pathname.includes('/new') || - (pathname.split('/').length > 4 && pathname !== '/dashboard/organizations'); + pathname !== '/organizations' && pathname.startsWith('/organizations'); return (
@@ -37,7 +37,6 @@ export default function OrganizationHeader() { />
- {/* Home Link */} - {showOrgSelector && } + {showOrgSelector && organizations && organizations.length > 0 && ( + setActiveOrg(orgId)} + /> + )}
- {/* User Avatar Dropdown */}