use button helper for exporting transactions
This commit is contained in:
parent
5529a8cd57
commit
e5208bb707
@ -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 {
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user