diff --git a/lib/src/view/puzzle/storm_dashboard.dart b/lib/src/view/puzzle/storm_dashboard.dart index 0cac14ba38..7c36f7098e 100644 --- a/lib/src/view/puzzle/storm_dashboard.dart +++ b/lib/src/view/puzzle/storm_dashboard.dart @@ -11,58 +11,43 @@ import 'package:lichess_mobile/src/utils/l10n_context.dart'; import 'package:lichess_mobile/src/widgets/list.dart'; import 'package:lichess_mobile/src/widgets/shimmer.dart'; import 'package:lichess_mobile/src/widgets/stat_card.dart'; -import 'package:lichess_mobile/src/widgets/user_full_name.dart'; class StormDashboardModal extends StatelessWidget { const StormDashboardModal({super.key, required this.user}); final LightUser user; + @override Widget build(BuildContext context) { return Theme.of(context).platform == TargetPlatform.iOS ? CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( - middle: _Title(user: user), + middle: Row( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(LichessIcons.storm, size: 20), + const SizedBox(width: 8.0), + Text(context.l10n.stormHighscores), + ], + ), ), child: _Body(user: user), ) : Scaffold( + body: _Body(user: user), appBar: AppBar( - titleSpacing: 0, - title: _Title(user: user), + title: Row( + children: [ + const Icon(LichessIcons.storm, size: 20), + const SizedBox(width: 8.0), + Text(context.l10n.stormHighscores), + ], + ), ), - body: _Body(user: user), ); } } -class _Title extends StatelessWidget { - const _Title({required this.user}); - - final LightUser user; - - @override - Widget build(BuildContext context) { - return Row( - children: [ - Flexible( - child: UserFullNameWidget(user: user), - ), - Flexible( - child: Row( - children: [ - const SizedBox(width: 8.0), - const Icon(LichessIcons.storm, size: 20), - const SizedBox(width: 8.0), - Text(context.l10n.stormHighscores), - ], - ), - ), - ], - ); - } -} - class _Body extends ConsumerWidget { const _Body({required this.user}); diff --git a/lib/src/view/user/perf_stats_screen.dart b/lib/src/view/user/perf_stats_screen.dart index aeeff325e5..048ebe9203 100644 --- a/lib/src/view/user/perf_stats_screen.dart +++ b/lib/src/view/user/perf_stats_screen.dart @@ -56,7 +56,7 @@ class PerfStatsScreen extends StatelessWidget { return Scaffold( appBar: AppBar( titleSpacing: 0, - title: _Title(user: user, perf: perf), + title: _Title(perf: perf), ), body: _Body(user: user, perf: perf), ); @@ -65,7 +65,7 @@ class PerfStatsScreen extends StatelessWidget { Widget _iosBuilder(BuildContext context) { return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( - middle: _Title(user: user, perf: perf), + middle: _Title(perf: perf), ), child: _Body(user: user, perf: perf), ); @@ -73,23 +73,18 @@ class PerfStatsScreen extends StatelessWidget { } class _Title extends StatelessWidget { - const _Title({required this.user, required this.perf}); + const _Title({required this.perf}); - final User user; final Perf perf; @override Widget build(BuildContext context) { return Row( children: [ - Flexible( - child: UserFullNameWidget(user: user.lightUser), - ), - Flexible( - child: Text( - ' ${context.l10n.perfStatPerfStats(perf.title)}', - overflow: TextOverflow.ellipsis, - ), + Icon(perf.icon), + Text( + ' ${context.l10n.perfStatPerfStats(perf.title)}', + overflow: TextOverflow.ellipsis, ), ], );