Skip to content

Commit 97fea64

Browse files
authored
Feat/create me dashbaord (#371)
* refactor: code structure for improved readability and maintainability * chore: update dependencies for @trezor packages and related modules * feat: remove redundant getMeWithStats function from auth API * feat: implement MeDashboard component and integrate user data fetching refactor: update user data structure in auth store and API response style: adjust sidebar inset background color and site header text color * feat: add delete campaign alert component and integrate into dashboard - Implemented DeleteCampaignAlert component for deleting crowdfunding campaigns with confirmation dialog and success/error handling. - Integrated RecentProjects component into MeDashboard to display user's recent projects. - Updated ActivityFeed and ProfileDataClient components to accommodate new user data structure. - Created RecentProjects component to list user's recent crowdfunding projects with sorting and pagination. - Enhanced ProjectsTab to reflect updated user data structure and display projects correctly. - Added smart breadcrumb navigation to SiteHeader for better user experience. - Introduced DataTablePagination for improved table navigation and row selection feedback. - Updated API methods for fetching crowdfunding projects and user data to align with new backend structure. - Refactored user and project types to accommodate changes in API response structure. * feat: add Submit Evidence Modal for milestone submissions - Implemented a new modal component for submitting evidence related to project milestones. - Added file upload functionality with validation for document types and sizes. - Included status selection and evidence description fields with character limits. - Integrated error handling and submission logic for milestone evidence. - Updated ProjectCard to use project slug instead of ID for routing. - Modified Confirm component to accept project slug. - Adjusted ProjectLayout and Milestone components for consistent styling and functionality. - Enhanced API functions for milestone management, including validation and document uploads. - Updated types to reflect changes in project structure and added new milestone-related functions. * feat: enhance FundingModal with message and anonymous contribution options * feat: Implement project creation and refactor project detail components into a new features directory. * feat: Refactor notification system with pagination, loading states, and updated project status handling * feat: Migrate ESLint configuration to `eslint.config.mjs` and update `eslint` and `@creit.tech/stellar-wallets-kit` dependencies.
1 parent ca36f2f commit 97fea64

216 files changed

Lines changed: 20330 additions & 5452 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

app/(landing)/about/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { Metadata } from 'next';
32
import { generatePageMetadata } from '@/lib/metadata';
43
import Missionpage from '@/components/About-Mission/Missionpage';
@@ -9,7 +8,7 @@ import Timeline from '@/components/landing-page/about/timeline/Timeline';
98
import TestimonialsSection from '@/components/testimonials/TestimonialsSection';
109
import { testimonials } from '@/components/testimonials/data/testimonial';
1110
import AboutUsHero2 from './AboutUsHero2';
12-
import OurTeam from './OurTeam';
11+
// import OurTeam from './OurTeam';
1312
import Partners from './Partners';
1413

1514
export const metadata: Metadata = generatePageMetadata('about');
@@ -22,7 +21,7 @@ const AboutPage = () => {
2221
<Missionpage />
2322
<AboutUsDifferent />
2423
<Timeline />
25-
<OurTeam />
24+
{/* <OurTeam /> */}
2625
<Partners />
2726
</div>
2827
<TestimonialsSection testimonials={testimonials} />

app/(landing)/hackathons/[slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { HackathonResources } from '@/components/hackathons/resources/resources'
1313
import SubmissionTab from '@/components/hackathons/submissions/submissionTab';
1414
import { HackathonDiscussions } from '@/components/hackathons/discussion/comment';
1515
import { TeamFormationTab } from '@/components/hackathons/team-formation/TeamFormationTab';
16-
import LoadingScreen from '@/components/landing-page/project/CreateProjectModal/LoadingScreen';
16+
import LoadingScreen from '@/features/projects/components/CreateProjectModal/LoadingScreen';
1717
import { useTimelineEvents } from '@/hooks/hackathon/use-timeline-events';
1818
import { toast } from 'sonner';
1919
import type { Participant } from '@/lib/api/hackathons';

app/(landing)/hackathons/[slug]/team-invitations/[token]/accept/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ const AcceptTeamInvitationPage = () => {
7272
}, 2000);
7373
}
7474
} catch (err: any) {
75-
console.error('Failed to accept invitation:', err);
76-
7775
const errorMessage = err?.message || 'Failed to accept invitation';
7876
setError(errorMessage);
7977

app/(landing)/hackathons/preview/[orgId]/[draftId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { HackathonBanner } from '@/components/hackathons/hackathonBanner';
88
import { HackathonNavTabs } from '@/components/hackathons/hackathonNavTabs';
99
import { HackathonOverview } from '@/components/hackathons/overview/hackathonOverview';
1010
import { HackathonResources } from '@/components/hackathons/resources/resources';
11-
import LoadingScreen from '@/components/landing-page/project/CreateProjectModal/LoadingScreen';
11+
import LoadingScreen from '@/features/projects/components/CreateProjectModal/LoadingScreen';
1212
import { Badge } from '@/components/ui/badge';
1313
import { BoundlessButton } from '@/components/buttons';
1414
import type { Hackathon } from '@/lib/api/hackathons';

app/(landing)/me/layout.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/(landing)/notifications/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import { useState } from 'react';
4-
import { useNotifications } from '@/hooks/use-notifications';
4+
import { useNotifications } from '@/hooks/useNotifications';
55
import { useNotificationPolling } from '@/hooks/use-notification-polling';
66
import { NotificationList } from '@/components/notifications/NotificationList';
77
import { Button } from '@/components/ui/button';
@@ -81,15 +81,15 @@ export default function NotificationsPage() {
8181
<div className='mb-6 flex items-center justify-between'>
8282
<div>
8383
<h1 className='text-3xl font-bold text-white'>Notifications</h1>
84-
<p className='mt-1 text-sm text-zinc-400'>
84+
<div className='mt-1 text-sm text-zinc-400'>
8585
{loading ? (
8686
<Skeleton className='h-4 w-48' />
8787
) : (
8888
<>
8989
{unreadCount} unread of {total} total
9090
</>
9191
)}
92-
</p>
92+
</div>
9393
</div>
9494
{unreadCount > 0 && !loading && (
9595
<Button
@@ -107,7 +107,7 @@ export default function NotificationsPage() {
107107
loading={loading}
108108
onNotificationClick={notification => {
109109
if (!notification.read) {
110-
markNotificationAsRead([notification._id]).catch(() => {
110+
markNotificationAsRead([notification.id]).catch(() => {
111111
// Silently handle error - user feedback already provided
112112
});
113113
}

app/(landing)/organizations/[id]/hackathons/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default function HackathonsPage() {
9595
organizationId,
9696
autoFetch: true,
9797
});
98-
console.log('hackathons', hackathons);
98+
9999
// Use the separate delete hook
100100
const { isDeleting, deleteHackathon } = useDeleteHackathon({
101101
organizationId,
@@ -119,7 +119,7 @@ export default function HackathonsPage() {
119119
type: 'draft' | 'hackathon';
120120
data: HackathonDraft | Hackathon;
121121
}> = [];
122-
console.log({ drafts });
122+
123123
drafts.forEach(draft => {
124124
if (statusFilter === 'all' || statusFilter === 'draft') {
125125
items.push({ type: 'draft', data: draft });
@@ -199,8 +199,8 @@ export default function HackathonsPage() {
199199

200200
try {
201201
await deleteHackathon();
202-
} catch (error) {
203-
console.error(error);
202+
} catch {
203+
// Error handled by toast in deleteHackathon hook
204204
} finally {
205205
setHackathonToDelete(null);
206206
}

app/(landing)/profile/[username]/profile-data.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { useEffect, useState } from 'react';
44
import { getUserProfileByUsername } from '@/lib/api/auth';
5-
import { PublicUserProfile } from '@/types/project';
5+
import { PublicUserProfile } from '@/features/projects/types';
66
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
77
import ActivityTab from '@/components/profile/ActivityTab';
88
import {
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
'use client';
2+
3+
import { use, useEffect, useState } from 'react';
4+
import { getCrowdfundingProject } from '@/features/projects/api';
5+
import type { Crowdfunding } from '@/features/projects/types';
6+
import { ContributionsDataTable } from '@/features/projects/components/Contributions/ContributionsDataTable';
7+
import { ArrowLeft } from 'lucide-react';
8+
import { Button } from '@/components/ui/button';
9+
import { useRouter } from 'next/navigation';
10+
11+
interface ContributionsPageProps {
12+
params: Promise<{
13+
slug: string;
14+
}>;
15+
}
16+
17+
export default function ContributionsPage({ params }: ContributionsPageProps) {
18+
const router = useRouter();
19+
const resolvedParams = use(params);
20+
const slug = resolvedParams.slug;
21+
22+
const [project, setProject] = useState<Crowdfunding | null>(null);
23+
const [loading, setLoading] = useState(true);
24+
25+
useEffect(() => {
26+
const fetchProject = async () => {
27+
try {
28+
setLoading(true);
29+
const data = await getCrowdfundingProject(slug);
30+
setProject(data);
31+
} catch {
32+
// Error handled by UI state
33+
} finally {
34+
setLoading(false);
35+
}
36+
};
37+
38+
fetchProject();
39+
}, [slug]);
40+
41+
return (
42+
<div className='bg-background-main-bg mx-auto flex min-h-screen max-w-[1440px] flex-col px-5 py-8 md:px-[50px] lg:px-[100px]'>
43+
{/* Header */}
44+
<div className='mb-8 space-y-4'>
45+
<Button
46+
variant='ghost'
47+
onClick={() => router.back()}
48+
className='-ml-2 text-[#B5B5B5] hover:bg-[#1A1A1A] hover:text-white'
49+
>
50+
<ArrowLeft className='mr-2 h-4 w-4' />
51+
Back
52+
</Button>
53+
54+
<div className='space-y-2'>
55+
<h1 className='text-3xl font-bold text-white'>Contributions</h1>
56+
{project && (
57+
<div className='flex items-center gap-3'>
58+
<p className='text-[#B5B5B5]'>
59+
Project:{' '}
60+
<span className='font-medium text-white'>
61+
{project.project.title}
62+
</span>
63+
</p>
64+
<span className='text-gray-800'></span>
65+
<p className='text-[#B5B5B5]'>
66+
{project.contributors.length}{' '}
67+
{project.contributors.length === 1
68+
? 'Contributor'
69+
: 'Contributors'}
70+
</p>
71+
</div>
72+
)}
73+
</div>
74+
</div>
75+
76+
{/* Table */}
77+
<div className='flex-1'>
78+
{loading ? (
79+
<div className='flex items-center justify-center py-20'>
80+
<div className='border-primary h-12 w-12 animate-spin rounded-full border-4 border-t-transparent' />
81+
</div>
82+
) : project ? (
83+
<ContributionsDataTable data={project.contributors} loading={false} />
84+
) : (
85+
<div className='flex items-center justify-center py-20'>
86+
<p className='text-gray-600'>Failed to load contributions</p>
87+
</div>
88+
)}
89+
</div>
90+
</div>
91+
);
92+
}

0 commit comments

Comments
 (0)