feat: toast system — feedback visuel global (react-hot-toast)
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 36s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 36s
- Toaster dark theme (bottom-right, 3s/4s) - Combat: erreur cooldown/endurance en toast - Craft: toast start + collect + erreurs - Forge: toast succès/échec + erreurs - Shop: toast achat + erreurs - Inventaire: toast vente + erreurs - Fix forge costs frontend (200/400/700)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useState, useCallback } from 'react';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import toast from 'react-hot-toast';
|
||||
import { combatApi, characterApi } from '../api/endpoints';
|
||||
import type { Monster, CombatResult, MultiCombatResult, CombatLog } from '../api/types';
|
||||
import { Swords, Trophy, Skull, Clock, Zap, Heart, Lock } from 'lucide-react';
|
||||
@@ -196,7 +197,7 @@ export function CombatPage() {
|
||||
qc.invalidateQueries({ queryKey: ['materialsInventory'] });
|
||||
startCooldown();
|
||||
},
|
||||
onError: () => startCooldown(),
|
||||
onError: (err: Error) => { toast.error(err.message); startCooldown(); },
|
||||
});
|
||||
|
||||
if (isLoading) return <div style={{ padding: '2rem', color: '#6b7a99' }}>Chargement des monstres…</div>;
|
||||
|
||||
Reference in New Issue
Block a user