Skip to content

Commit

Permalink
fix(app): Do not mix up trades tab with orders tab
Browse files Browse the repository at this point in the history
  • Loading branch information
luckysori committed Jun 5, 2024
1 parent dddf292 commit 9bc1c9f
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions mobile/lib/features/trade/trade_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class TradeScreen extends StatelessWidget {
selectedIndex: 0,
keys: const [
tradeScreenTabsPositions,
tradeScreenTabsTrades,
tradeScreenTabsOrders
tradeScreenTabsOrders,
tradeScreenTabsTrades
],
tabBarViewChildren: [
ListView.builder(
Expand Down Expand Up @@ -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: <TextSpan>[
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",
Expand All @@ -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: <TextSpan>[
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",
Expand All @@ -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(),
))),
],
),
)
Expand Down

0 comments on commit 9bc1c9f

Please sign in to comment.