use button helper for exporting transactions

This commit is contained in:
Michael Mallan 2025-01-03 10:20:23 +00:00
parent 5529a8cd57
commit e5208bb707
No known key found for this signature in database
GPG Key ID: 5177CDCEDB0EABEB
2 changed files with 6 additions and 12 deletions

View File

@ -1,13 +1,12 @@
use iced::{
widget::{progress_bar, Button, Column, Container, Row, Space},
widget::{progress_bar, Column, Container, Row, Space},
Length,
};
use liana_ui::{
component::{
card,
button, card,
text::{h4_bold, text},
},
theme,
widget::Element,
};
@ -22,14 +21,13 @@ pub fn export_modal<'a>(
) -> Element<'a, Message> {
let button = match state {
ExportState::Started | ExportState::Progress(_) => {
Some(Button::new("Cancel").on_press(ExportMessage::UserStop.into()))
Some(button::secondary(None, "Cancel").on_press(ExportMessage::UserStop.into()))
}
ExportState::Ended | ExportState::TimedOut | ExportState::Aborted => {
Some(Button::new("Close").on_press(ExportMessage::Close.into()))
Some(button::secondary(None, "Close").on_press(ExportMessage::Close.into()))
}
_ => None,
}
.map(|b| b.height(32).style(theme::Button::Primary));
};
let msg = if let Some(error) = error {
format!("{:?}", error)
} else {

View File

@ -45,11 +45,7 @@ pub fn transactions_view<'a>(
Row::new()
.push(Container::new(h3("Transactions")))
.push(Space::with_width(Length::Fill))
.push(
Button::new("Export")
.on_press(ExportMessage::Open.into())
.style(theme::Button::Secondary),
),
.push(button::secondary(None, "Export").on_press(ExportMessage::Open.into())),
)
.push(
Column::new()