|
| 1 | +use iced::Alignment::Center; |
| 2 | +use iced::Element; |
| 3 | +use iced::Fill; |
| 4 | +use iced::Length; |
| 5 | +use iced::Padding; |
| 6 | +use iced::widget::Space; |
| 7 | +use iced::widget::button; |
| 8 | +use iced::widget::column; |
| 9 | +use iced::widget::container; |
| 10 | +use iced::widget::image; |
| 11 | +use iced::widget::row; |
| 12 | +use iced::widget::text; |
| 13 | + |
| 14 | +use crate::BDK_ICON_PATH; |
| 15 | +use crate::BONSAI_ICON_DARK_PATH; |
| 16 | +use crate::BonsaiMessage; |
| 17 | +use crate::FLORESTA_ICON_PATH; |
| 18 | +use crate::common::interface::button::image_button; |
| 19 | +use crate::common::interface::font::BERKELEY_MONO_BOLD; |
| 20 | +use crate::node::style::table_cell; |
| 21 | + |
| 22 | +pub(crate) fn view_about<'a>() -> Element<'a, BonsaiMessage> { |
| 23 | + let content = column![ |
| 24 | + container( |
| 25 | + image(BONSAI_ICON_DARK_PATH) |
| 26 | + .width(Length::Fixed(170.0)) |
| 27 | + .height(Length::Fixed(170.0)) |
| 28 | + ) |
| 29 | + .style(table_cell()) |
| 30 | + .padding(1), |
| 31 | + text("BONSAI").font(BERKELEY_MONO_BOLD).size(36), |
| 32 | + Space::new().height(10.0), |
| 33 | + text("Bonsai is a desktop wallet with an embbeded node, built as a showcase of `bdk_floresta`, a novel chain-source crate for BDK that leverages Floresta and Utreexo to keep a compact full node running within the application, enabling completely trustless and on-device validation and blockchain data fetching. Zero API calls means better user privacy and sovereignty.").align_x(Center), |
| 34 | + Space::new().height(Fill), |
| 35 | + text("POWERED BY").font(BERKELEY_MONO_BOLD).size(24), |
| 36 | + Space::new().height(15.0), |
| 37 | + row![ |
| 38 | + column![ |
| 39 | + button( |
| 40 | + container( |
| 41 | + image(BDK_ICON_PATH) |
| 42 | + .width(Length::Fixed(170.0)) |
| 43 | + .height(Length::Fixed(170.0)) |
| 44 | + ) |
| 45 | + ) |
| 46 | + .on_press(BonsaiMessage::OpenLink("https://bitcoindevkit.org".to_string())) |
| 47 | + .padding(0) |
| 48 | + .style(image_button()), |
| 49 | + text("Bitcoin Dev Kit") |
| 50 | + ].align_x(Center).spacing(4), |
| 51 | + column![ |
| 52 | + button( |
| 53 | + container( |
| 54 | + image(FLORESTA_ICON_PATH) |
| 55 | + .width(Length::Fixed(170.0)) |
| 56 | + .height(Length::Fixed(170.0)) |
| 57 | + ) |
| 58 | + ) |
| 59 | + .on_press(BonsaiMessage::OpenLink("https://getfloresta.org".to_string())) |
| 60 | + .padding(0) |
| 61 | + .style(image_button()), |
| 62 | + text("Floresta") |
| 63 | + ].align_x(Center).spacing(4), |
| 64 | + ].align_y(Center).spacing(20) |
| 65 | + ] |
| 66 | + .align_x(Center); |
| 67 | + |
| 68 | + container(content) |
| 69 | + .width(Length::Fill) |
| 70 | + .height(Length::Fill) |
| 71 | + .align_x(Center) |
| 72 | + .align_y(Center) |
| 73 | + .padding(Padding::from([40.0, 150.0])) |
| 74 | + .into() |
| 75 | +} |
0 commit comments