From 9bc1c9fdfb1e8d2af7d64e77237a6283e435c781 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 5 Jun 2024 22:19:13 +1000 Subject: [PATCH] fix(app): Do not mix up trades tab with orders tab --- mobile/lib/features/trade/trade_screen.dart | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mobile/lib/features/trade/trade_screen.dart b/mobile/lib/features/trade/trade_screen.dart index 5fdf9bfe6..8053f5847 100644 --- a/mobile/lib/features/trade/trade_screen.dart +++ b/mobile/lib/features/trade/trade_screen.dart @@ -109,8 +109,8 @@ class TradeScreen extends StatelessWidget { selectedIndex: 0, keys: const [ tradeScreenTabsPositions, - tradeScreenTabsTrades, - tradeScreenTabsOrders + tradeScreenTabsOrders, + tradeScreenTabsTrades ], tabBarViewChildren: [ ListView.builder( @@ -192,13 +192,14 @@ class TradeScreen extends StatelessWidget { ); }, ), - tradeChangeNotifier.trades.isEmpty + // If there are no orders we early-return with placeholder + orderChangeNotifier.orders.isEmpty ? RichText( text: TextSpan( style: DefaultTextStyle.of(context).style, children: [ const TextSpan( - text: "You don't have any trades yet.\n\n", + text: "You don't have any orders yet.\n\n", style: TextStyle(color: Colors.grey)), TextSpan( text: "Buy", @@ -215,19 +216,18 @@ class TradeScreen extends StatelessWidget { : SingleChildScrollView( physics: const AlwaysScrollableScrollPhysics(), child: Card( - child: Column( - children: tradeChangeNotifier.trades - .map((trade) => TradeListItem(trade: trade)) - .toList(), - ))), - // If there are no positions we early-return with placeholder - orderChangeNotifier.orders.isEmpty + child: Column( + children: orderChangeNotifier.orders.values + .map((e) => OrderListItem(order: e)) + .toList()), + )), + tradeChangeNotifier.trades.isEmpty ? RichText( text: TextSpan( style: DefaultTextStyle.of(context).style, children: [ const TextSpan( - text: "You don't have any orders yet.\n\n", + text: "You don't have any trades yet.\n\n", style: TextStyle(color: Colors.grey)), TextSpan( text: "Buy", @@ -244,11 +244,11 @@ class TradeScreen extends StatelessWidget { : SingleChildScrollView( physics: const AlwaysScrollableScrollPhysics(), child: Card( - child: Column( - children: orderChangeNotifier.orders.values - .map((e) => OrderListItem(order: e)) - .toList()), - )) + child: Column( + children: tradeChangeNotifier.trades + .map((trade) => TradeListItem(trade: trade)) + .toList(), + ))), ], ), )