Skip to content

Commit

Permalink
Remove fake tx button
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed May 15, 2024
1 parent 82fc5b2 commit c7f8bfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
11 changes: 0 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ pub enum Message {
Donate,
// Core messages we get from core
CoreMessage(CoreUIMsg),
// Fake stuff for testing
FakeAddTransaction,
}

// This is the UI state. It should only contain data that is directly rendered by the UI
Expand Down Expand Up @@ -338,15 +336,6 @@ impl HarborWallet {
println!("Copying to clipboard: {s}");
clipboard::write(s)
}
Message::FakeAddTransaction => {
if self.transaction_history.len() % 2 == 0 {
self.transaction_history
.push(TransactionItem::make_dummy_onchain());
} else {
self.transaction_history.push(TransactionItem::make_dummy());
}
Command::none()
}
// Handle any messages we get from core
Message::CoreMessage(msg) => match msg {
CoreUIMsg::Sending => {
Expand Down
7 changes: 2 additions & 5 deletions src/routes/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@ use iced::widget::{column, container, scrollable};
use iced::Element;
use iced::{Length, Padding};

use crate::components::{h_button, h_header, h_transaction_item, SvgIcon};
use crate::components::{h_header, h_transaction_item};
use crate::{HarborWallet, Message};

pub fn history(harbor: &HarborWallet) -> Element<Message> {
let header = h_header("History", "Here's what's happened so far.");

let fake_button =
h_button("Add Transaction", SvgIcon::Squirrel, false).on_press(Message::FakeAddTransaction);

let transactions = harbor
.transaction_history
.iter()
.fold(column![], |column, item| {
column.push(h_transaction_item(item))
});

let column = column![header, fake_button, transactions].spacing(48);
let column = column![header, transactions].spacing(48);

container(scrollable(
column
Expand Down

0 comments on commit c7f8bfe

Please sign in to comment.