From 36af35fae3f21995fcbe0c4c1a5f685a2318d0a0 Mon Sep 17 00:00:00 2001 From: edouardparis Date: Wed, 30 Oct 2024 11:52:23 +0100 Subject: [PATCH] refac: remove select button at the choose template step --- gui/src/installer/view/editor/template/mod.rs | 91 ++++++++----------- 1 file changed, 40 insertions(+), 51 deletions(-) diff --git a/gui/src/installer/view/editor/template/mod.rs b/gui/src/installer/view/editor/template/mod.rs index 90f6ab6f..66859aac 100644 --- a/gui/src/installer/view/editor/template/mod.rs +++ b/gui/src/installer/view/editor/template/mod.rs @@ -6,10 +6,8 @@ use iced::{alignment, Alignment, Length}; use liana_ui::{ color, - component::{ - button, card, - text::{h3, p1_regular, p2_regular}, - }, + component::text::{h3, p1_regular, p2_regular}, + theme, widget::*, }; @@ -26,64 +24,55 @@ pub fn choose_descriptor_template(progress: (usize, usize)) -> Element<'static, .align_items(Alignment::Start) .push(Container::new( p1_regular("What do you want your wallet for? This depends on the amount of funds you have, the more funds, the higher the security should be. Not sure about the wallet type? We can help you.") - .style(color::GREY_2) - .horizontal_alignment(alignment::Horizontal::Left) + .style(color::GREY_2) + .horizontal_alignment(alignment::Horizontal::Left) ).align_x(alignment::Horizontal::Left).width(Length::Fill)) .push( - card::simple( - Row::new() - .align_items(Alignment::Center) - .push( - Column::new() - .align_items(Alignment::Start) - .push(h3("Simple inheritance")) - .push(p2_regular("Two keys required, one for yourself to spend and another for your heir.").style(color::GREY_2)) - .width(Length::Fill) - ) - .push(button::secondary(None, "Select").on_press( - Message::SelectDescriptorTemplate( - context::DescriptorTemplate::SimpleInheritance, - ), - )), + Button::new( + Column::new() + .align_items(Alignment::Start) + .push(h3("Simple inheritance")) + .push(p2_regular("Two keys required, one for yourself to spend and another for your heir.").style(color::GREY_2)) + .width(Length::Fill) ) + .padding(15) + .on_press( + Message::SelectDescriptorTemplate( + context::DescriptorTemplate::SimpleInheritance, + ) + ).style(theme::Button::Secondary) .width(Length::Fill), ) .push( - card::simple( - Row::new() - .align_items(Alignment::Center) - .push( - Column::new() - .align_items(Alignment::Start) - .push(h3("Multisig security wallet")) - .push(p2_regular("A secure scheme requiring stricter multiparty signature and recovery.").style(color::GREY_2)) - .width(Length::Fill) - ) - .push(button::secondary(None, "Select").on_press( - Message::SelectDescriptorTemplate( - context::DescriptorTemplate::MultisigSecurity, - ), - )), + Button::new( + Column::new() + .align_items(Alignment::Start) + .push(h3("Multisig security wallet")) + .push(p2_regular("A secure scheme requiring stricter multiparty signature and recovery.").style(color::GREY_2)) + .width(Length::Fill) ) + .padding(15) + .on_press( + Message::SelectDescriptorTemplate( + context::DescriptorTemplate::MultisigSecurity, + ) + ).style(theme::Button::Secondary) .width(Length::Fill), ) .push( - card::simple( - Row::new() - .align_items(Alignment::Center) - .push( - Column::new() - .align_items(Alignment::Start) - .push(h3("Custom (choose your own)")) - .push(p2_regular("Create a custom setup that fits all your needs").style(color::GREY_2)) - .width(Length::Fill) - ) - .push(button::secondary(None, "Select").on_press( - Message::SelectDescriptorTemplate( - context::DescriptorTemplate::Custom , - ), - )), + Button::new( + Column::new() + .align_items(Alignment::Start) + .push(h3("Custom (choose your own)")) + .push(p2_regular("Create a custom setup that fits all your needs.").style(color::GREY_2)) + .width(Length::Fill) ) + .padding(15) + .on_press( + Message::SelectDescriptorTemplate( + context::DescriptorTemplate::Custom, + ) + ).style(theme::Button::Secondary) .width(Length::Fill), ) .spacing(20),