ui: add history events to design-system

This commit is contained in:
edouard committed 2023-04-20 12:20:48 +02:00
1 parent 196b8cc3e9
commit e7e8028d8a
17 files changed
+173 -34

No files matched your search

+1
View File
@@ -9,6 +9,7 @@ edition = "2021"
iced = "0.7"
iced_native = "0.8"
web-sys = "0.3.61"
chrono = "0.4"
liana_ui = { path = "../.." }
[workspace]
+7 -4
View File
@@ -45,6 +45,7 @@ impl Application for DesignSystem {
Box::new(section::Typography {}),
Box::new(section::Buttons {}),
Box::new(section::HardwareWallets {}),
Box::new(section::Events {}),
],
current: 0,
};
@@ -123,12 +124,14 @@ impl Application for DesignSystem {
.height(Length::Fill);
container(row![
sidebar.width(Length::Units(200)),
Space::with_width(Length::Units(150)),
scrollable(column![
sidebar.width(Length::FillPortion(2)),
Space::with_width(Length::FillPortion(1)),
container(scrollable(column![
Space::with_height(Length::Units(150)),
container(self.sections[self.current].view()).width(Length::Fill)
]),
]))
.width(Length::FillPortion(8)),
Space::with_width(Length::FillPortion(1)),
])
.width(Length::Fill)
.height(Length::Fill)
+31 -1
View File
@@ -5,7 +5,7 @@ use iced::{
};
use liana_ui::{
color,
component::{hw, separation, text::*},
component::{amount::Amount, event, hw, separation, text::*},
theme,
widget::Element,
};
@@ -253,3 +253,33 @@ impl Section for HardwareWallets {
.into()
}
}
pub struct Events {}
impl Section for Events {
fn title(&self) -> &'static str {
"Events "
}
fn view(&self) -> Element<Message> {
column![
h1(self.title()),
column![
event::unconfirmed_outgoing_event(&Amount::from_sat(32934234), Message::Ignore),
event::confirmed_outgoing_event(
chrono::NaiveDate::from_ymd_opt(2023, 04, 19).unwrap(),
&Amount::from_sat(32934234),
Message::Ignore
),
event::unconfirmed_incoming_event(&Amount::from_sat(32934234), Message::Ignore),
event::confirmed_incoming_event(
chrono::NaiveDate::from_ymd_opt(2023, 04, 19).unwrap(),
&Amount::from_sat(32934234),
Message::Ignore
)
]
.spacing(20)
]
.spacing(100)
.into()
}
}