From 89cf8767079c41d5aa32c49c676c18fecc7e300f Mon Sep 17 00:00:00 2001 From: tikaiz Date: Thu, 12 Mar 2026 11:06:46 +0100 Subject: [PATCH] add placeholder in carousel --- .../write-prompts-md.instructions.md | 2 +- docs/prompt.md | 6 ++++ .../lib/widgets/my_tournaments_carousel.dart | 34 ++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/instructions/write-prompts-md.instructions.md b/.github/instructions/write-prompts-md.instructions.md index 8068d4e..efeb9a9 100644 --- a/.github/instructions/write-prompts-md.instructions.md +++ b/.github/instructions/write-prompts-md.instructions.md @@ -1,6 +1,6 @@ --- description: Instructions for documenting prompts and file changes in docs/prompt.md -applyTo: 'docs/prompt.md' # Auto-apply when docs/prompt.md is involved +applyTo: '**' --- # Writing Prompts to docs/prompt.md diff --git a/docs/prompt.md b/docs/prompt.md index 83d31e3..57fcce9 100644 --- a/docs/prompt.md +++ b/docs/prompt.md @@ -71,3 +71,9 @@ Folgende Dateien wurden in diesem Prompt verändert: - Fix the carousel not reloading when the reload button is pressed or when a tournament is joined.

Folgende Dateien wurden in diesem Prompt verändert: - frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart + +## 12.03.2026 + +- Show a placeholder in the carousel if no tournaments were found.

+Folgende Dateien wurden in diesem Prompt verändert: + - frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart diff --git a/frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart b/frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart index 22981cd..bae1864 100644 --- a/frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart +++ b/frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart @@ -32,7 +32,39 @@ class _MyTournamentsCarouselState extends State { final tournaments = snapshot.data ?? []; if (tournaments.isEmpty) { - return const SizedBox.shrink(); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.fromLTRB(16, 16, 16, 8), + child: Text( + 'My Tournaments', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + ), + SizedBox( + height: 150, + child: Card( + margin: const EdgeInsets.symmetric(horizontal: 8), + elevation: 4, + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.emoji_events_outlined, size: 48, color: Colors.grey), + const SizedBox(height: 8), + const Text( + 'No tournaments found', + style: TextStyle(fontSize: 16, color: Colors.grey), + ), + ], + ), + ), + ), + ), + const SizedBox(height: 16), + ], + ); } return Column(