Skip to content

Commit 57e2df7

Browse files
0xDeon0xdevcollins
andauthored
Launch Campaign: Review and Launch Implementation (#125)
* feat: implement Launch Campaign feature with review and success components- Added new components for Launch Campaign flow, including ReviewCampaign and CampaignLiveSuccess.- Integrated campaign details fetching and launching functionality.- Implemented share functionality for campaigns with social media options.- Updated project structure to include new components and API endpoints for campaign management.- Enhanced user experience with loading states and error handling during campaign launch. * feat: enhance ReviewCampaign component and add slim scrollbar styling - Updated ReviewCampaign component layout for improved responsiveness and visual hierarchy. - Replaced User icon with UserCheck2 for better representation of verified users. - Added financial target display and progress bar for clearer fundraising metrics. - Enhanced engagement metrics section with consistent styling. - Introduced slim scrollbar styling in globals.css for a cleaner UI experience. * refactor: clean up middleware code for better readability and functionality - Removed commented-out code for protected route checks. - Ensured the logic for redirecting unauthenticated users to the signin page is active and properly formatted. * feat: update CampaignLiveSuccess and LaunchCampaignFlow components for improved UI and functionality - Refactored button styles in CampaignLiveSuccess for better visual consistency. - Added mock campaign details in LaunchCampaignFlow to enhance campaign setup. - Updated LoadingSpinner color in LaunchCampaignFlow for improved visibility during loading states. * fix: resolve SSR build errors for user pages and auth components - Add dynamic rendering to user layout to prevent pre-rendering issues - Add client-side hydration checks to user page and sidebar components - Fix localStorage and cookie access for SSR compatibility - Remove problematic static generation exports - Ensure auth hooks only run on client side * feat: added progress bar * feat: added campaign images * feat: dropdown fixes * Update CampaignLiveSuccess.tsx * fix: reverted some changes --------- Co-authored-by: Collins Ikechukwu <collinschristroa@gmail.com>
1 parent 5d42c12 commit 57e2df7

34 files changed

Lines changed: 1812 additions & 192 deletions

.env.example

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,52 @@
1+
# Stellar Network Configuration
12
NEXT_PUBLIC_STELLAR_NETWORK=testnet
3+
# Options: testnet, public
24

5+
# Application Configuration
36
NEXT_PUBLIC_APP_URL=http://localhost:3000
7+
# Your application's public URL
48

5-
NEXT_PUBLIC_API_URL=https://staging-api.boundlessfi.xyz/api
9+
# API Configuration
10+
NEXT_PUBLIC_API_URL=http://localhost:8000/api
11+
# Your backend API URL
612

13+
# WalletConnect Configuration
714
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_project_id
815
# Get this from https://cloud.walletconnect.com/
916

17+
# Stellar Horizon URLs (optional - defaults will be used)
1018
NEXT_PUBLIC_HORIZON_TESTNET_URL=https://horizon-testnet.stellar.org
1119
NEXT_PUBLIC_HORIZON_PUBLIC_URL=https://horizon.stellar.org
1220

21+
# Application Metadata
1322
NEXT_PUBLIC_APP_NAME=Boundless
1423
NEXT_PUBLIC_APP_DESCRIPTION=Stellar-based application
1524
NEXT_PUBLIC_APP_ICON=/logo.svg
1625

26+
# Development Settings
1727
NEXT_PUBLIC_DEBUG_MODE=false
28+
# Enable debug logging for wallet operations
1829

30+
# Feature Flags
1931
NEXT_PUBLIC_ENABLE_WALLET_CONNECT=true
2032
NEXT_PUBLIC_ENABLE_MULTI_WALLET=true
2133
NEXT_PUBLIC_ENABLE_NETWORK_SWITCHING=true
2234

35+
# NextAuth Configuration
2336
NEXTAUTH_SECRET=your_nextauth_secret_here
37+
# Generate a random string for this secret
38+
# You can use: openssl rand -base64 32
2439

2540
NEXTAUTH_URL=http://localhost:3000
41+
# Your application's public URL (same as NEXT_PUBLIC_APP_URL)
2642

43+
# Google OAuth Configuration
2744
GOOGLE_CLIENT_ID=your_google_client_id
45+
# Get this from Google Cloud Console
2846

2947
GOOGLE_CLIENT_SECRET=your_google_client_secret
48+
# Get this from Google Cloud Console
3049

50+
# Environment
3151
NODE_ENV=development
32-
33-
34-
35-
52+
# Options: development, production, test

LAUNCH_CAMPAIGN_README.md

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# Launch Campaign: Review and Launch Implementation
2+
3+
This document describes the implementation of the Launch Campaign: Review and Launch feature for the Boundless platform.
4+
5+
## Overview
6+
7+
The Launch Campaign feature allows users to review their campaign details and launch their campaign after completing the initialization and validation steps. The implementation includes:
8+
9+
1. **Review Campaign Screen** - Displays all campaign details for final review
10+
2. **Campaign Live Success Screen** - Shows success message after launch
11+
3. **Share Campaign Modal** - Allows sharing on social media platforms
12+
4. **API Integration** - Mock endpoints for testing
13+
14+
## Components
15+
16+
### 1. ReviewCampaign Component
17+
18+
- **Location**: `components/project/ReviewCampaign.tsx`
19+
- **Purpose**: Displays campaign details for final review before launch
20+
- **Features**:
21+
- Campaign header with creator info and financials
22+
- Engagement metrics (likes, comments, backers, days left)
23+
- Campaign description and tags
24+
- Campaign photos gallery
25+
- Expandable milestones with details
26+
- Confirmation checkbox
27+
- Back and Launch buttons
28+
29+
### 2. CampaignLiveSuccess Component
30+
31+
- **Location**: `components/project/CampaignLiveSuccess.tsx`
32+
- **Purpose**: Displays success screen after campaign launch
33+
- **Features**:
34+
- Large checkmark icon
35+
- Success message
36+
- Campaign preview
37+
- Back to Dashboard and Share buttons
38+
- Campaign link with copy functionality
39+
40+
### 3. ShareCampaignModal Component
41+
42+
- **Location**: `components/project/ShareCampaignModal.tsx`
43+
- **Purpose**: Modal for sharing campaign on social media
44+
- **Features**:
45+
- Copyable campaign link
46+
- Social media sharing buttons (Discord, X/Twitter, WhatsApp, Telegram)
47+
- Campaign preview
48+
- Copy to clipboard functionality
49+
50+
### 4. LaunchCampaignFlow Component
51+
52+
- **Location**: `components/project/LaunchCampaignFlow.tsx`
53+
- **Purpose**: Manages the entire launch flow
54+
- **Features**:
55+
- State management for review, launching, and success steps
56+
- Loading states during campaign launch
57+
- Error handling
58+
- Integration with API endpoints
59+
60+
## API Endpoints
61+
62+
### Mock Implementation
63+
64+
The following endpoints are currently mocked for testing:
65+
66+
1. **getCampaignDetails(projectId)** - Fetches campaign details for review
67+
2. **launchCampaign(projectId)** - Launches the campaign (simulates blockchain deployment)
68+
3. **generateCampaignLink(projectId)** - Generates shareable campaign link
69+
70+
### Real Implementation
71+
72+
When backend endpoints are available, replace the mock implementations in `lib/api/project.ts` with actual API calls.
73+
74+
## Integration
75+
76+
### ProjectSheetFlow Integration
77+
78+
The Launch Campaign step has been integrated into the existing `ProjectSheetFlow` component:
79+
80+
1. **Step 1**: Initialize (existing)
81+
2. **Step 2**: Validate (existing, updated with onSuccess callback)
82+
3. **Step 3**: Launch Campaign (new)
83+
84+
### Flow Progression
85+
86+
- After validation success, the flow automatically progresses to the Launch Campaign step
87+
- Users can navigate back to previous steps
88+
- The stepper UI updates to reflect current progress
89+
90+
## Testing
91+
92+
### Test Button
93+
94+
A test button has been added to the dashboard (`app/dashboard/page.tsx`) to test the Launch Campaign flow:
95+
96+
1. Navigate to `/dashboard`
97+
2. Click "Test Launch Campaign" button
98+
3. The flow will open in a modal sheet
99+
4. Test the review, launch, and success screens
100+
101+
### Mock Data
102+
103+
Mock campaign data is defined in `lib/mock.ts` and includes:
104+
105+
- Campaign details matching the Figma designs
106+
- Realistic milestone information
107+
- Engagement metrics
108+
- Creator information
109+
110+
## Design System Compliance
111+
112+
The implementation follows the existing design system:
113+
114+
- **Colors**: Uses predefined theme colors (`#F5F5F5`, `#B5B5B5`, `#2A2A2A`, etc.)
115+
- **Typography**: Consistent with existing components
116+
- **Spacing**: Follows established patterns
117+
- **Components**: Reuses existing UI components (Button, Badge, Dialog, etc.)
118+
- **Icons**: Uses Lucide React icons as specified
119+
120+
## Accessibility
121+
122+
The implementation includes accessibility features:
123+
124+
- Proper ARIA labels
125+
- Keyboard navigation support
126+
- Screen reader friendly content
127+
- Focus management
128+
- Color contrast compliance
129+
130+
## Responsive Design
131+
132+
All components are responsive and work on:
133+
134+
- Desktop (default)
135+
- Tablet (responsive breakpoints)
136+
- Mobile (optimized layouts)
137+
138+
## Error Handling
139+
140+
The implementation includes comprehensive error handling:
141+
142+
- API error states
143+
- Loading states
144+
- Empty states
145+
- User-friendly error messages
146+
- Graceful fallbacks
147+
148+
## Future Enhancements
149+
150+
When backend integration is complete:
151+
152+
1. Replace mock API calls with real endpoints
153+
2. Add real-time status updates during campaign launch
154+
3. Implement actual blockchain transaction handling
155+
4. Add campaign analytics and tracking
156+
5. Implement real social media sharing with tracking
157+
158+
## File Structure
159+
160+
```
161+
components/project/
162+
├── ReviewCampaign.tsx # Review campaign details
163+
├── CampaignLiveSuccess.tsx # Success screen after launch
164+
├── ShareCampaignModal.tsx # Social media sharing modal
165+
├── LaunchCampaignFlow.tsx # Main flow controller
166+
└── index.ts # Component exports
167+
168+
lib/
169+
├── api/
170+
│ └── project.ts # API functions (mock)
171+
└── mock.ts # Mock data
172+
173+
app/dashboard/
174+
└── page.tsx # Test button integration
175+
```
176+
177+
## Usage
178+
179+
To use the Launch Campaign flow:
180+
181+
1. Import the components:
182+
183+
```tsx
184+
import { LaunchCampaignFlow } from '@/components/project';
185+
```
186+
187+
2. Use in your component:
188+
189+
```tsx
190+
<LaunchCampaignFlow
191+
projectId='your-project-id'
192+
onBack={() => {
193+
/* handle back */
194+
}}
195+
onComplete={() => {
196+
/* handle completion */
197+
}}
198+
/>
199+
```
200+
201+
The implementation is ready for testing and can be easily integrated with real backend endpoints when available.

app/comment/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Page = () => {
1717
if (comment && comment.trim()) {
1818
// Comment is valid and can be processed
1919
// Add your comment handling logic here
20-
console.log('Comment submitted:', comment);
20+
// console.log('Comment submitted:', comment);
2121

2222
// Close the sheet after submission
2323
setIsSheetOpen(false);

app/globals.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,18 @@
158158
button {
159159
cursor: pointer;
160160
}
161+
162+
/* reduce scrollbar width */
163+
.slim-scrollbar {
164+
overflow-y: scroll;
165+
scrollbar-width: thin;
166+
scrollbar-color: var(--background);
167+
}
168+
169+
.slim-scrollbar::-webkit-scrollbar-thumb {
170+
background-color: rgba(255, 255, 255, 0.2);
171+
}
172+
173+
.slim-scrollbar::-webkit-scrollbar-track {
174+
background-color: transparent;
175+
}

app/test/page.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
'use client';
2+
3+
import { useState } from 'react';
4+
import LaunchCampaignFlow from '@/components/project/LaunchCampaignFlow';
5+
import BoundlessSheet from '@/components/sheet/boundless-sheet';
6+
import { Button } from '@/components/ui/button';
7+
import { Rocket } from 'lucide-react';
8+
9+
export default function TestPage() {
10+
const [showLaunchFlow, setShowLaunchFlow] = useState(false);
11+
12+
const handleOpenModal = () => {
13+
setShowLaunchFlow(true);
14+
};
15+
16+
const handleCloseModal = () => {
17+
setShowLaunchFlow(false);
18+
};
19+
20+
return (
21+
<div className='min-h-screen bg-gray-900 flex items-center justify-center'>
22+
<div className='text-center space-y-6'>
23+
<h1 className='text-4xl font-bold text-white mb-8'>
24+
Launch Campaign Test
25+
</h1>
26+
27+
<p className='text-gray-300 mb-8'>
28+
Click the button below to test the Launch Campaign feature
29+
</p>
30+
31+
<Button
32+
onClick={handleOpenModal}
33+
size='lg'
34+
className='bg-green-600 hover:bg-green-700 text-white px-8 py-4 text-lg'
35+
>
36+
<Rocket className='mr-2 h-6 w-6' />
37+
Test Launch Campaign
38+
</Button>
39+
40+
{/* Debug info */}
41+
<div className='text-white text-sm'>
42+
Modal state: {showLaunchFlow ? 'Open' : 'Closed'}
43+
</div>
44+
45+
{/* Launch Campaign Flow Modal */}
46+
<BoundlessSheet
47+
open={showLaunchFlow}
48+
setOpen={handleCloseModal}
49+
contentClassName='h-full'
50+
title='Review Campaign'
51+
>
52+
<LaunchCampaignFlow
53+
projectId='test-project-123'
54+
onBack={handleCloseModal}
55+
onComplete={handleCloseModal}
56+
/>
57+
</BoundlessSheet>
58+
</div>
59+
</div>
60+
);
61+
}

app/user/layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import SidebarLayout from '@/components/layout/sidebar';
44
import { SidebarProvider } from '@/components/ui/sidebar';
55
import { redirect } from 'next/navigation';
66

7+
// Force dynamic rendering for all user pages
8+
export const dynamic = 'force-dynamic';
9+
710
export default async function UserLayout({
811
children,
912
}: Readonly<{

app/user/page.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,35 @@ import GrantHistory from '@/components/overview/GrantHistory';
88
import PageTransition from '@/components/PageTransition';
99
import { Coins, History } from 'lucide-react';
1010
import { useAuth } from '@/hooks/use-auth';
11+
import { useEffect, useState } from 'react';
12+
13+
import LoadingSpinner from '@/components/LoadingSpinner';
1114

1215
export default function UserPage() {
13-
const { user } = useAuth();
16+
const { user, isLoading } = useAuth();
17+
const [mounted, setMounted] = useState(false);
18+
19+
useEffect(() => {
20+
setMounted(true);
21+
}, []);
22+
23+
// Show loading until client-side hydration is complete
24+
if (!mounted || isLoading) {
25+
return (
26+
<div className='min-h-screen flex items-center justify-center'>
27+
<LoadingSpinner size='lg' />
28+
</div>
29+
);
30+
}
31+
1432
return (
1533
<PageTransition>
1634
<div className='min-h-screen'>
1735
<div className='p-4 sm:p-6 lg:p-8 max-w-7xl mx-auto'>
1836
{/* Header Section */}
1937
<div className='mb-8'>
2038
<h1 className='text-2xl sm:text-3xl lg:text-[32px] font-medium leading-[120%] tracking-[-0.64px] text-white '>
21-
Hello, {user?.name?.split(' ')[0]}
39+
Hello, {user?.name?.split(' ')[0] || 'User'}
2240
</h1>
2341
</div>
2442
{/* Stats Cards Grid */}

0 commit comments

Comments
 (0)