diff --git a/applications/tari_console_wallet/src/ui/app.rs b/applications/tari_console_wallet/src/ui/app.rs index 1baccfa568..833fd14764 100644 --- a/applications/tari_console_wallet/src/ui/app.rs +++ b/applications/tari_console_wallet/src/ui/app.rs @@ -34,7 +34,6 @@ use crate::{ notifier::Notifier, ui::{ components::{ - assets_tab::AssetsTab, base_node::BaseNode, contacts_tab::ContactsTab, events_component::EventsComponent, @@ -45,7 +44,6 @@ use crate::{ receive_tab::ReceiveTab, send_tab::SendTab, tabs_container::TabsContainer, - tokens_component::TokensComponent, transactions_tab::TransactionsTab, Component, }, @@ -94,8 +92,6 @@ impl App { .add("Receive".into(), Box::new(ReceiveTab::new())) .add("Contacts".into(), Box::new(ContactsTab::new())) .add("Network".into(), Box::new(NetworkTab::new(base_node_selected))) - .add("Assets".into(), Box::new(AssetsTab::new())) - .add("Tokens".into(), Box::new(TokensComponent::new())) .add("Events".into(), Box::new(EventsComponent::new())) .add("Log".into(), Box::new(LogTab::new())) .add("Notifications".into(), Box::new(NotificationTab::new())); diff --git a/applications/tari_console_wallet/src/ui/components/assets_tab.rs b/applications/tari_console_wallet/src/ui/components/assets_tab.rs deleted file mode 100644 index 688b7015b9..0000000000 --- a/applications/tari_console_wallet/src/ui/components/assets_tab.rs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -use tui::{ - backend::Backend, - layout::{Constraint, Layout, Rect}, - style::{Modifier, Style}, - text::{Span, Spans}, - widgets::{Block, Borders, Paragraph, Row, Table, TableState, Wrap}, - Frame, -}; - -use crate::ui::{ - components::{styles, Component}, - state::AppState, -}; - -pub struct AssetsTab { - table_state: TableState, -} - -impl AssetsTab { - pub fn new() -> Self { - Self { - table_state: TableState::default(), - } - } -} - -impl Component for AssetsTab { - fn draw(&mut self, f: &mut Frame, area: Rect, _app_state: &AppState) { - let list_areas = Layout::default() - .constraints([Constraint::Length(1), Constraint::Min(42)].as_ref()) - .split(area); - - let instructions = Paragraph::new(Spans::from(vec![ - Span::raw("Use "), - Span::styled("Up↑/Down↓ Keys", Style::default().add_modifier(Modifier::BOLD)), - Span::raw(" to select a contract."), - ])) - .wrap(Wrap { trim: true }); - - f.render_widget(instructions, list_areas[0]); - - let rows: Vec<_> = Vec::new(); - let table = Table::new(rows) - .header(Row::new(vec!["Name", "Status", "Pub Key", "Owner"]).style(styles::header_row())) - .block(Block::default().title("Assets").borders(Borders::ALL)) - .widths(&[Constraint::Length(30 + 20 + 64 + 64)]) - .highlight_style(styles::highlight()) - .highlight_symbol(">>"); - f.render_stateful_widget(table, list_areas[1], &mut self.table_state); - } - - fn on_up(&mut self, _app_state: &mut AppState) {} - - fn on_down(&mut self, _app_state: &mut AppState) {} -} diff --git a/applications/tari_console_wallet/src/ui/components/mod.rs b/applications/tari_console_wallet/src/ui/components/mod.rs index 43d129edcd..7d4a48925d 100644 --- a/applications/tari_console_wallet/src/ui/components/mod.rs +++ b/applications/tari_console_wallet/src/ui/components/mod.rs @@ -20,7 +20,6 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -pub mod assets_tab; pub mod balance; pub mod base_node; mod component; @@ -32,7 +31,6 @@ pub mod receive_tab; pub mod send_tab; mod styles; pub mod tabs_container; -pub mod tokens_component; pub mod transactions_tab; pub use self::component::*; pub mod contacts_tab; diff --git a/applications/tari_console_wallet/src/ui/components/tokens_component.rs b/applications/tari_console_wallet/src/ui/components/tokens_component.rs deleted file mode 100644 index 33a0175229..0000000000 --- a/applications/tari_console_wallet/src/ui/components/tokens_component.rs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2021. The Tari Project -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the -// following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following -// disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the -// following disclaimer in the documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -use tui::{ - backend::Backend, - layout::{Constraint, Rect}, - widgets::{Block, Borders, Row, Table, TableState}, - Frame, -}; - -use crate::ui::{ - components::{styles, Component}, - state::AppState, -}; - -pub struct TokensComponent { - table_state: TableState, -} - -impl TokensComponent { - pub fn new() -> Self { - Self { - table_state: TableState::default(), - } - } -} - -impl Component for TokensComponent { - fn draw(&mut self, f: &mut Frame, area: Rect, _app_state: &AppState) { - let rows: Vec<_> = Vec::new(); - let table = Table::new(rows) - .header(Row::new(vec!["Name", "Status", "Asset Pub Key", "Unique ID", "Owner"]).style(styles::header_row())) - .block(Block::default().title("Tokens").borders(Borders::ALL)) - .widths(&[ - Constraint::Length(30), - Constraint::Length(20), - Constraint::Length(32), - Constraint::Length(32), - Constraint::Length(64), - ]) - .highlight_style(styles::highlight()) - .highlight_symbol(">>"); - f.render_stateful_widget(table, area, &mut self.table_state) - } - - fn on_up(&mut self, _app_state: &mut AppState) {} - - fn on_down(&mut self, _app_state: &mut AppState) {} -}