Skip to content

Commit

Permalink
Merge pull request #2612 from get10101/fix/trades-tab
Browse files Browse the repository at this point in the history
Do not mix up trades tab with orders tab
  • Loading branch information
luckysori authored Jun 5, 2024
2 parents dddf292 + 9bc1c9f commit f261e77
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 f261e77

Please sign in to comment.