From 88b2dddba0c4782c894421e40cebdd1af4465cda Mon Sep 17 00:00:00 2001 From: spinline Date: Thu, 5 Feb 2026 21:26:28 +0300 Subject: [PATCH] fix(toast): use proper DaisyUI alert structure with SVG icons --- frontend/src/components/toast.rs | 44 +++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/toast.rs b/frontend/src/components/toast.rs index d0543cd..dd79064 100644 --- a/frontend/src/components/toast.rs +++ b/frontend/src/components/toast.rs @@ -8,10 +8,10 @@ use shared::NotificationLevel; /// Returns the DaisyUI alert class for the notification level fn get_alert_class(level: &NotificationLevel) -> &'static str { match level { - NotificationLevel::Info => "alert-info", - NotificationLevel::Success => "alert-success", - NotificationLevel::Warning => "alert-warning", - NotificationLevel::Error => "alert-error", + NotificationLevel::Info => "alert alert-info", + NotificationLevel::Success => "alert alert-success", + NotificationLevel::Warning => "alert alert-warning", + NotificationLevel::Error => "alert alert-error", } } @@ -23,20 +23,34 @@ fn ToastItem( ) -> impl IntoView { let alert_class = get_alert_class(&level); - let icon = match level { - NotificationLevel::Info => "ℹ️", - NotificationLevel::Success => "✓", - NotificationLevel::Warning => "⚠️", - NotificationLevel::Error => "✕", + // DaisyUI SVG icons + let icon_svg = match level { + NotificationLevel::Info => view! { + + + + }.into_view(), + NotificationLevel::Success => view! { + + + + }.into_view(), + NotificationLevel::Warning => view! { + + + + }.into_view(), + NotificationLevel::Error => view! { + + + + }.into_view(), }; view! { -
- {icon} - {message} +
+ {icon_svg} + {message}
} }