refactor(frontend): replace alert() with modern toast notifications

Replaced all alert() calls with react-hot-toast notifications for better
user experience. Toast notifications are non-blocking, auto-dismiss, and
provide visual feedback with icons based on message type.

Changes:
- EventChatPage: Match request success/error toasts
- MatchChatPage: Video file selection and WebRTC connection error toasts
- MatchesPage: Match accept/reject action toasts
- RatePartnerPage: Rating submission and validation toasts
- VerifyEmailPage: Email verification sent toast
- ScheduleConfigSection: Schedule save success/error toasts
- MatchingConfigSection: Deadline save success/error toasts

All toast notifications use appropriate types (success, error, warning, info)
for better visual distinction and user feedback.
This commit is contained in:
Radosław Gierwiało
2025-12-05 22:09:37 +01:00
parent 3ae9fd149b
commit bb8a876ab0
7 changed files with 31 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
import { useState, useEffect } from 'react';
import toast from 'react-hot-toast';
import { Layers, Plus, Trash2, Save, RefreshCw } from 'lucide-react';
import { matchingAPI, divisionsAPI } from '../../services/api';
@@ -72,10 +73,11 @@ const ScheduleConfigSection = ({ slug, event, onRefresh }) => {
? { slots: scheduleSlots.filter(s => s.divisionIds.length > 0) }
: null;
await matchingAPI.setScheduleConfig(slug, scheduleConfig);
toast.success('Schedule saved successfully');
onRefresh?.();
} catch (err) {
console.error('Failed to save schedule:', err);
alert('Nie udalo sie zapisac harmonogramu');
toast.error('Failed to save schedule');
} finally {
setSavingSchedule(false);
}