From 356301c79c6f621e8329287f70a112ddbb16d43d Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 23 Apr 2025 15:13:34 +0100 Subject: [PATCH] feat: add brief overview of recovery feature This adds some explantory text about the recovery panel. For consistency, the text stating that no recovery paths are available will be shown in the same card as when recovery paths are available, which will help differentiate between this text and the explanatory text. --- liana-gui/src/app/view/recovery.rs | 35 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/liana-gui/src/app/view/recovery.rs b/liana-gui/src/app/view/recovery.rs index de3dcb83..e866f2dc 100644 --- a/liana-gui/src/app/view/recovery.rs +++ b/liana-gui/src/app/view/recovery.rs @@ -34,33 +34,40 @@ pub fn recovery<'a>( warning: Option<&Error>, ) -> Element<'a, Message> { let no_recovery_paths = recovery_paths.is_empty(); + const INFO_TEXT: &str = "Recover your funds by sending them to another wallet if you have lost access to your primary spending path."; dashboard( &Menu::Recovery, cache, warning, Column::new() .push(Container::new(h3("Recovery")).width(Length::Fill)) + .push(Container::new(text(INFO_TEXT))) .push(Space::with_height(Length::Fixed(20.0))) - .push(if no_recovery_paths { - Container::new(text("No recovery path is currently available")) - } else { + .push( Container::new( Column::new() - .spacing(20) - .push(text(format!( - "{} recovery path{} available:", - recovery_paths.len(), - if recovery_paths.len() > 1 { - "s are" + .push( + text(if no_recovery_paths { + "No recovery path is currently available.".to_string() } else { - " is" - }, - ))) + format!( + "{} recovery path{} available:", + recovery_paths.len(), + if recovery_paths.len() > 1 { + "s are" + } else { + " is" + }, + ) + }) + .width(Length::Fill), + ) + .push_maybe((!no_recovery_paths).then_some(Space::with_height(20))) .push(Column::with_children(recovery_paths).spacing(20)), ) .style(theme::card::simple) - .padding(20) - }) + .padding(20), + ) .push_maybe(if no_recovery_paths { None } else {