diff --git a/frontend/src/components/ui/toast.rs b/frontend/src/components/ui/toast.rs index c9fb60c..3200d09 100644 --- a/frontend/src/components/ui/toast.rs +++ b/frontend/src/components/ui/toast.rs @@ -66,18 +66,11 @@ pub fn SonnerTrigger( _ => "bg-primary", }; - // List Layout Logic (No stacking/overlapping) + // Simplified Style (No manual translateY needed with Flexbox) let style = move || { - let is_bottom = position.to_string().contains("Bottom"); - let y_direction = if is_bottom { -1.0 } else { 1.0 }; - - // Dynamic Y position based on index (index 0 is the newest/bottom-most in the view) - let y = index as f64 * 72.0; // Height (approx 64px) + Gap (8px) - format!( - "z-index: {}; transform: translateY({}px); opacity: 1; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;", - total - index, - y * y_direction + "z-index: {}; opacity: 1; transition: all 0.3s ease;", + total - index ) }; @@ -105,9 +98,8 @@ pub fn SonnerTrigger( view! {
impl IntoView { let store = use_context::().expect("Toaster context not found"); let toasts = store.toasts; - let is_hovered = RwSignal::new(false); + + let is_bottom = position.to_string().contains("Bottom"); let container_class = match position { SonnerPosition::TopLeft => "left-6 top-6 items-start", @@ -175,17 +168,16 @@ pub fn Toaster(#[prop(default = SonnerPosition::default())] position: SonnerPosi
>() + list.into_iter().enumerate().collect::>() } key=|(_, toast)| toast.id children=move |(index, toast)| { @@ -199,7 +191,7 @@ pub fn Toaster(#[prop(default = SonnerPosition::default())] position: SonnerPosi index=index total=total position=position - is_expanded=is_hovered.into() + is_expanded=Signal::derive(move || true) on_dismiss=Callback::new(move |_| { is_exiting.set(true); leptos::task::spawn_local(async move {