From 223336637f08fb0a9c746ab6e309e0e43b6b3c45 Mon Sep 17 00:00:00 2001 From: Ilyass-Bougati Date: Thu, 28 May 2026 21:07:02 +0100 Subject: [PATCH 1/3] Made the ban screen look desirable --- client/deepdame/.metadata | 25 +- .../lib/features/banned/banned_screen.dart | 231 +++++++++--------- 2 files changed, 119 insertions(+), 137 deletions(-) diff --git a/client/deepdame/.metadata b/client/deepdame/.metadata index 83b34ebb..1590e483 100644 --- a/client/deepdame/.metadata +++ b/client/deepdame/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "f6ff1529fd6d8af5f706051d9251ac9231c83407" + revision: "00b0c91f06209d9e4a41f71b7a512d6eb3b9c694" channel: "stable" project_type: app @@ -13,26 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - - platform: android - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - - platform: ios - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - - platform: linux - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - - platform: macos - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 + base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 - platform: web - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - - platform: windows - create_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 - base_revision: f6ff1529fd6d8af5f706051d9251ac9231c83407 + create_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 + base_revision: 00b0c91f06209d9e4a41f71b7a512d6eb3b9c694 # User provided section diff --git a/client/deepdame/lib/features/banned/banned_screen.dart b/client/deepdame/lib/features/banned/banned_screen.dart index dadc04e3..0f9d760d 100644 --- a/client/deepdame/lib/features/banned/banned_screen.dart +++ b/client/deepdame/lib/features/banned/banned_screen.dart @@ -1,5 +1,5 @@ -import 'package:deepdame/core/theme/themes/extensions/status_pill_colors.dart'; import 'package:deepdame/features/auth/application/auth_controller.dart'; +import 'package:deepdame/features/shader/swirl_background.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:go_router/go_router.dart'; @@ -9,150 +9,147 @@ class BannedScreen extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final cs = Theme.of(context).colorScheme; - - final statusColors = Theme.of( - context, - ).extension()?.banned; - final banColor = statusColors?.text ?? const Color(0xFFDC2626); - final banBgColor = statusColors?.background ?? const Color(0xFFFEE2E2); - return PopScope( canPop: false, child: Scaffold( - body: SafeArea( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 32), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: 96, - height: 96, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: banBgColor, - ), - child: Icon( - Icons.block_rounded, - size: 48, - color: banColor, + body: SwirlBackground( + variant: SwirlVariant.error, + child: SafeArea( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 32), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 96, + height: 96, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white.withValues(alpha: 0.2), + ), + child: const Icon( + Icons.block_rounded, + size: 48, + color: Colors.white, + ), ), - ), - const SizedBox(height: 28), + const SizedBox(height: 28), - Text( - 'Account banned', - style: TextStyle( - fontSize: 26, - fontWeight: FontWeight.w800, - color: banColor, + const Text( + 'Account banned', + style: TextStyle( + fontSize: 26, + fontWeight: FontWeight.w800, + color: Colors.white, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - ), - const SizedBox(height: 12), + const SizedBox(height: 12), - Text( - 'Your account has been suspended by an administrator. ' - 'If you believe this is a mistake, please contact support.', - style: TextStyle( - fontSize: 15, - color: cs.onSurface.withValues(alpha: 0.6), - height: 1.5, + Text( + 'Your account has been suspended by an administrator. ' + 'If you believe this is a mistake, please contact support.', + style: TextStyle( + fontSize: 15, + color: Colors.white.withValues(alpha: 0.8), + height: 1.5, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - ), - const SizedBox(height: 28), + const SizedBox(height: 28), - Container( - width: double.infinity, - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 14, - ), - decoration: BoxDecoration( - color: cs.surface, - borderRadius: BorderRadius.circular(12), - border: Border.all( - color: cs.outline.withValues(alpha: 0.2), + Container( + width: double.infinity, + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 14, ), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Reason', - style: TextStyle( - fontSize: 12, - color: cs.onSurface.withValues(alpha: 0.5), - ), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.15), + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: Colors.white.withValues(alpha: 0.25), ), - const SizedBox(height: 4), - Text( - 'Violation of community guidelines', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.w500, - color: cs.onSurface, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Reason', + style: TextStyle( + fontSize: 12, + color: Colors.white.withValues(alpha: 0.6), + ), ), - ), - ], + const SizedBox(height: 4), + const Text( + 'Violation of community guidelines', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.w500, + color: Colors.white, + ), + ), + ], + ), ), - ), - const SizedBox(height: 32), + const SizedBox(height: 32), - SizedBox( - width: double.infinity, - child: OutlinedButton( - onPressed: () {}, - style: OutlinedButton.styleFrom( - side: BorderSide( - color: cs.outline.withValues(alpha: 0.4), - ), - padding: const EdgeInsets.symmetric(vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + SizedBox( + width: double.infinity, + child: OutlinedButton( + onPressed: () {}, + style: OutlinedButton.styleFrom( + foregroundColor: Colors.white, + side: BorderSide( + color: Colors.white.withValues(alpha: 0.5), + ), + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), ), - ), - child: const Text( - 'Contact support', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, + child: const Text( + 'Contact support', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), ), ), ), - ), - const SizedBox(height: 12), + const SizedBox(height: 12), - SizedBox( - width: double.infinity, - child: OutlinedButton( - onPressed: () => _signOut(context, ref), - style: OutlinedButton.styleFrom( - side: BorderSide( - color: cs.outline.withValues(alpha: 0.4), - ), - padding: const EdgeInsets.symmetric(vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + SizedBox( + width: double.infinity, + child: OutlinedButton( + onPressed: () => _signOut(context, ref), + style: OutlinedButton.styleFrom( + foregroundColor: Colors.white, + side: BorderSide( + color: Colors.white.withValues(alpha: 0.5), + ), + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), ), - ), - child: const Text( - 'Sign out', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, + child: const Text( + 'Sign out', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), ), ), ), - ), - ], + ], + ), ), ), ), From d92faffd615a8f6b71f714a0245448a34921f687 Mon Sep 17 00:00:00 2001 From: Ilyass-Bougati Date: Thu, 28 May 2026 21:11:46 +0100 Subject: [PATCH 2/3] Logout revokes the device token now --- .../main/java/com/deepdame/controller/AuthController.java | 1 + .../src/main/java/com/deepdame/service/user/UserService.java | 1 + .../main/java/com/deepdame/service/user/UserServiceImpl.java | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java b/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java index bf23505a..23c9c49f 100644 --- a/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java +++ b/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java @@ -68,6 +68,7 @@ public ResponseEntity register(@RequestBody @Valid RegisterRequest request) { @PostMapping("/logout") public ResponseEntity logout(@AuthenticationPrincipal CustomUserDetails principal) { userService.logout(principal.getUser().getId()); + userService.revokeDeviceToken(principal.getUser().getId()); return ResponseEntity.ok() .header(HttpHeaders.SET_COOKIE, CookieUtils.genCookie("access_token", "", 0, "/").toString()) diff --git a/server/DeepDame/src/main/java/com/deepdame/service/user/UserService.java b/server/DeepDame/src/main/java/com/deepdame/service/user/UserService.java index 4cbb6f7a..01b94e65 100644 --- a/server/DeepDame/src/main/java/com/deepdame/service/user/UserService.java +++ b/server/DeepDame/src/main/java/com/deepdame/service/user/UserService.java @@ -28,4 +28,5 @@ public interface UserService extends CrudDtoService { void updateImageUrl(UUID id, String imageUrl); void updateDeviceToken(UUID id, String token); String getDeviceToken(UUID id); + void revokeDeviceToken(UUID id); } diff --git a/server/DeepDame/src/main/java/com/deepdame/service/user/UserServiceImpl.java b/server/DeepDame/src/main/java/com/deepdame/service/user/UserServiceImpl.java index b141b7a7..dd13850d 100644 --- a/server/DeepDame/src/main/java/com/deepdame/service/user/UserServiceImpl.java +++ b/server/DeepDame/src/main/java/com/deepdame/service/user/UserServiceImpl.java @@ -277,4 +277,9 @@ public void updateDeviceToken(UUID id, String token) { public String getDeviceToken(UUID id) { return userRepository.getDeviceTokenById(id); } + + @Override + public void revokeDeviceToken(UUID id) { + userRepository.updateDeviceToken(id, null); + } } From a71d85b5eaaa30513bba5e80a518ce6af2b052d2 Mon Sep 17 00:00:00 2001 From: Ilyass-Bougati Date: Thu, 28 May 2026 21:27:29 +0100 Subject: [PATCH 3/3] Banned page --- .../lib/features/banned/banned_screen.dart | 52 +++++++------------ 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/client/deepdame/lib/features/banned/banned_screen.dart b/client/deepdame/lib/features/banned/banned_screen.dart index 0f9d760d..51c7cbc3 100644 --- a/client/deepdame/lib/features/banned/banned_screen.dart +++ b/client/deepdame/lib/features/banned/banned_screen.dart @@ -23,14 +23,14 @@ class BannedScreen extends ConsumerWidget { Container( width: 96, height: 96, - decoration: BoxDecoration( + decoration: const BoxDecoration( shape: BoxShape.circle, - color: Colors.white.withValues(alpha: 0.2), + color: Colors.white, ), child: const Icon( Icons.block_rounded, size: 48, - color: Colors.white, + color: Colors.red, ), ), @@ -101,51 +101,37 @@ class BannedScreen extends ConsumerWidget { SizedBox( width: double.infinity, - child: OutlinedButton( - onPressed: () {}, - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - side: BorderSide( - color: Colors.white.withValues(alpha: 0.5), - ), + child: ElevatedButton( + onPressed: () => _signOut(context, ref), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + foregroundColor: Colors.black87, padding: const EdgeInsets.symmetric(vertical: 16), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), ), child: const Text( - 'Contact support', + 'Sign out', style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, + color: Colors.red, ), ), ), ), - const SizedBox(height: 12), + const SizedBox(height: 4), - SizedBox( - width: double.infinity, - child: OutlinedButton( - onPressed: () => _signOut(context, ref), - style: OutlinedButton.styleFrom( - foregroundColor: Colors.white, - side: BorderSide( - color: Colors.white.withValues(alpha: 0.5), - ), - padding: const EdgeInsets.symmetric(vertical: 16), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - ), - child: const Text( - 'Sign out', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - ), - ), + TextButton( + onPressed: () {}, + style: TextButton.styleFrom( + foregroundColor: Colors.white.withValues(alpha: 0.6), + ), + child: const Text( + 'Contact support', + style: TextStyle(fontSize: 14), ), ), ],