Skip to content

Commit 894d564

Browse files
format
1 parent a422456 commit 894d564

10 files changed

Lines changed: 53 additions & 62 deletions

File tree

backend/config/socket.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const initializeSocket = (httpServer: HTTPServer): SocketIOServer => {
4444
}
4545
});
4646

47-
io.on('connection', (socket) => {
47+
io.on('connection', socket => {
4848
console.log(`User connected: ${socket.data.userId} (Socket: ${socket.id})`);
4949

5050
socket.on('disconnect', () => {
@@ -110,17 +110,12 @@ export const getSocketIO = (): SocketIOServer => {
110110
return io;
111111
};
112112

113-
export const emitToConversation = (
114-
conversationId: string,
115-
event: string,
116-
data: any
117-
): void => {
113+
export const emitToConversation = (conversationId: string, event: string, data: any): void => {
118114
if (io) {
119115
io.to(`conversation:${conversationId}`).emit(event, data);
120116
}
121117
};
122118

123-
124119
export const emitToUser = (userId: string, event: string, data: any): void => {
125120
// Implement userId -> socketId mapping
126121
// You can store this mapping when users connect

backend/types/socket.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,6 @@ export interface SocketData {
144144

145145
import { Server, Socket } from 'socket.io';
146146

147-
export type TypedServer = Server<
148-
ClientToServerEvents,
149-
ServerToClientEvents,
150-
{},
151-
SocketData
152-
>;
153-
154-
export type TypedSocket = Socket<
155-
ClientToServerEvents,
156-
ServerToClientEvents,
157-
{},
158-
SocketData
159-
>;
147+
export type TypedServer = Server<ClientToServerEvents, ServerToClientEvents, {}, SocketData>;
148+
149+
export type TypedSocket = Socket<ClientToServerEvents, ServerToClientEvents, {}, SocketData>;

frontend/src/components/StripePaymentForm.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,33 @@
1616
// const [error, setError] = useState<string | null>(null);
1717
// const [processing, setProcessing] = useState(false);
1818

19-
// const handleSubmit = async (e: React.FormEvent) => {
20-
// e.preventDefault();
19+
// const handleSubmit = async (e: React.FormEvent) => {
20+
// e.preventDefault();
2121

22-
// Implement payment confirmation with Stripe
23-
// Handle success/error states
24-
// Call onSuccess when payment succeeds
22+
// Implement payment confirmation with Stripe
23+
// Handle success/error states
24+
// Call onSuccess when payment succeeds
2525

26-
// setError('Not implemented');
27-
// };
26+
// setError('Not implemented');
27+
// };
2828

29-
// return (
30-
// <form onSubmit={handleSubmit} className="space-y-4">
31-
{/* Add PaymentElement from Stripe */}
32-
{/* Add error display */}
33-
{/* Add submit button with loading state */}
29+
// return (
30+
// <form onSubmit={handleSubmit} className="space-y-4">
31+
{
32+
/* Add PaymentElement from Stripe */
33+
}
34+
{
35+
/* Add error display */
36+
}
37+
{
38+
/* Add submit button with loading state */
39+
}
3440

35-
{/* <div className="alert alert-warning">
41+
{
42+
/* <div className="alert alert-warning">
3643
<span>Implement Stripe payment form</span>
3744
</div>
3845
</form>
3946
);
40-
} */}
47+
} */
48+
}

frontend/src/config/socket.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ export const initializeSocket = (token: string): TypedSocket => {
3030
console.log('Socket.IO connected:', socket?.id);
3131
});
3232

33-
socket.on('disconnect', (reason) => {
33+
socket.on('disconnect', reason => {
3434
console.log('Socket.IO disconnected:', reason);
3535
});
3636

37-
socket.on('connect_error', (error) => {
37+
socket.on('connect_error', error => {
3838
console.error('Socket.IO connection error:', error.message);
3939
});
4040

41-
socket.on('error', (data) => {
41+
socket.on('error', data => {
4242
console.error('Socket.IO error:', data.message);
4343
});
4444

@@ -70,7 +70,6 @@ export const isSocketConnected = (): boolean => {
7070
return socket?.connected ?? false;
7171
};
7272

73-
7473
/**
7574
* Join a conversation room to receive real-time updates
7675
*/
@@ -114,10 +113,7 @@ export const markAsReadViaSocket = (conversationId: string): void => {
114113
/**
115114
* Send typing indicator
116115
*/
117-
export const sendTypingIndicator = (
118-
conversationId: string,
119-
isTyping: boolean
120-
): void => {
116+
export const sendTypingIndicator = (conversationId: string, isTyping: boolean): void => {
121117
if (socket && socket.connected) {
122118
socket.emit('typing', { conversationId, isTyping });
123119
}

frontend/src/config/stripe.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
import { loadStripe } from '@stripe/stripe-js';
22

3-
export const stripePromise = loadStripe(
4-
import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY || ''
5-
);
3+
export const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY || '');

frontend/src/hooks/mutations/useEvents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function useUpdateEvent() {
2828

2929
return useMutation({
3030
// add appropriate parameter to async
31-
mutationFn: async ({ }: any) => {
31+
mutationFn: async ({}: any) => {
3232
// Implement API call to PUT /api/events/:id
3333
throw new Error('Not implemented');
3434
},
@@ -84,7 +84,7 @@ export function useRSVP() {
8484
const queryClient = useQueryClient();
8585

8686
return useMutation({
87-
mutationFn: async ({ }: any) => {
87+
mutationFn: async ({}: any) => {
8888
// Implement API call to POST /api/events/:eventId/rsvp
8989
throw new Error('Not implemented');
9090
},

frontend/src/hooks/mutations/useMessages.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export function useSendMessage() {
99
const queryClient = useQueryClient();
1010

1111
return useMutation({
12-
mutationFn: async (_data: { conversationId: string; content: string; attachments?: string[] }) => {
12+
mutationFn: async (_data: {
13+
conversationId: string;
14+
content: string;
15+
attachments?: string[];
16+
}) => {
1317
// Implement API call to POST /api/messages/messages
1418
throw new Error('Not implemented');
1519
},

frontend/src/pages/Admin/EventManagementPage/EventManagementPage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ export function EventManagementPage() {
1313
// Handle delete event with useDeleteEvent()
1414

1515
return (
16-
<div className="p-6">
17-
<div className="flex justify-between items-center mb-6">
18-
<h1 className="text-3xl font-bold">Event Management</h1>
16+
<div className='p-6'>
17+
<div className='flex justify-between items-center mb-6'>
18+
<h1 className='text-3xl font-bold'>Event Management</h1>
1919
<button
2020
// onClick={() => setShowCreateModal(true)}
21-
className="btn btn-primary"
21+
className='btn btn-primary'
2222
>
2323
Create Event
2424
</button>
2525
</div>
2626

27-
<div className="alert alert-info">
27+
<div className='alert alert-info'>
2828
<span>Implement event management page</span>
29-
<ul className="list-disc ml-6 mt-2">
29+
<ul className='list-disc ml-6 mt-2'>
3030
<li>Display all events with filters (draft, published, etc.)</li>
3131
<li>Create event form (title, description, date/time, location, zoom link)</li>
3232
<li>Edit existing events</li>

frontend/src/pages/OrganizationView/EventsPage/EventsPage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export function EventsPage() {
1010
// Handle RSVP submission with useRSVP()
1111

1212
return (
13-
<div className="p-6">
14-
<h1 className="text-3xl font-bold mb-6">Upcoming Events</h1>
13+
<div className='p-6'>
14+
<h1 className='text-3xl font-bold mb-6'>Upcoming Events</h1>
1515

16-
<div className="alert alert-info">
16+
<div className='alert alert-info'>
1717
<span>Implement events page</span>
18-
<ul className="list-disc ml-6 mt-2">
18+
<ul className='list-disc ml-6 mt-2'>
1919
<li>Display upcoming events in cards/list</li>
2020
<li>Show event details (title, date, location, zoom link)</li>
2121
<li>Display RSVP count and max attendees</li>

frontend/src/pages/OrganizationView/SubscriptionPage/SubscriptionPage.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export function SubscriptionPage() {
1818
// Handle cancel subscription with useCancelSubscription()
1919

2020
return (
21-
<div className="p-6">
22-
<h1 className="text-3xl font-bold mb-6">Subscription Management</h1>
21+
<div className='p-6'>
22+
<h1 className='text-3xl font-bold mb-6'>Subscription Management</h1>
2323

24-
<div className="alert alert-info">
24+
<div className='alert alert-info'>
2525
<span>Implement subscription page</span>
26-
<ul className="list-disc ml-6 mt-2">
26+
<ul className='list-disc ml-6 mt-2'>
2727
<li>Show current subscription status</li>
2828
<li>Display available pricing plans</li>
2929
<li>Handle subscription creation with Stripe</li>

0 commit comments

Comments
 (0)