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.
This commit is contained in:
Michael Mallan 2025-04-23 15:13:34 +01:00
parent 30aedb3e5b
commit 356301c79c
No known key found for this signature in database
GPG Key ID: 5177CDCEDB0EABEB

View File

@ -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 {