Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aliTanveerAnalog authored and dvc94ch committed Jan 10, 2023
1 parent 4d08fce commit 287bbcc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
40 changes: 20 additions & 20 deletions dioxus-wallet/src/components/txn_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ pub fn TransactionList(
chain: Chain,
) -> Element {
cx.render(rsx! {
transactions.iter().map(|tx| {
transactions.iter().map(|tx| {
if let Some(metadata) = tx.transaction.metadata.clone(){
let sender = metadata["from"].clone();
let amount = metadata["amount"].as_str().unwrap();
let is_sender = chain_state.account.eq(&sender);
let converted_amount = convert_to_highest_unit(
amount.to_string(),
chain.clone()).unwrap_or_else(|_|{"0".to_string()});
amount.to_string(), *chain).unwrap_or_else(|_|{"0".to_string()});
let (title,address,icon) = match is_sender {
true => (
"SENT",
Expand All @@ -31,7 +30,7 @@ pub fn TransactionList(
img!("receive-txn.png")
)
};
rsx! {
rsx! {
div {
class: "transaction-item",
div {
Expand All @@ -41,25 +40,26 @@ pub fn TransactionList(
src: icon,
}
}
div {
class: "tx-content-container",
div {
class: "tx-title",
"{title}"
class: "tx-content-container",
div {
class: "tx-title",
"{title}"
}
div {
class: "txn-address",
"{address}"
}
}
div {
class: "txn-address",
"{address}"
}
}
div {
class: "tx-amount",
"{converted_amount}"
class: "tx-amount",
"{converted_amount}"
}
}
}
}
}
else {rsx!({})}
}
} else {
rsx!{{}}
}
})
})
})
}
4 changes: 2 additions & 2 deletions dioxus-wallet/src/routes/txns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn Txns(cx: Scope) -> Element {
let alerts = use_atom_ref(&cx, ALERTS);
let router = use_router(&cx);
let loader_state = use_set(&cx, LOADER).clone();
let transactions_state: &UseRef<Vec<BlockTransaction>> = use_ref(&cx, || vec![]);
let transactions_state: &UseRef<Vec<BlockTransaction>> = use_ref(&cx, Vec::new);
cx.use_hook(|| {
let alerts = alerts.clone();
let transactions_state = transactions_state.clone();
Expand Down Expand Up @@ -81,7 +81,7 @@ pub fn Txns(cx: Scope) -> Element {
uri: img!("send.png")
}
}
div{
div {
class:"transaction-container",
TransactionList {
chain_state:state.clone(),
Expand Down

0 comments on commit 287bbcc

Please sign in to comment.