From 4f7c2fbe8767b384e4a244172e1029c6f4b45cae Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Fri, 10 Jan 2025 05:23:56 +0100 Subject: [PATCH] Outdated explanations --- packages/smooth_app/lib/l10n/app_en.arb | 5 +++ packages/smooth_app/lib/l10n/app_fr.arb | 5 +++ .../pages/product/edit_language_tabbar.dart | 2 +- .../product/edit_ocr/edit_ocr_image.dart | 42 +++++++++++++++---- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/packages/smooth_app/lib/l10n/app_en.arb b/packages/smooth_app/lib/l10n/app_en.arb index 985110dc085e..f7fc30d03e1b 100644 --- a/packages/smooth_app/lib/l10n/app_en.arb +++ b/packages/smooth_app/lib/l10n/app_en.arb @@ -793,6 +793,11 @@ } }, "product_image_outdated": "This image may be outdated", + "product_image_outdated_explanations_title": "This image may be outdated", + "product_image_outdated_explanations_content": "This image was taken more than a year ago.\n**Please check that's it's still up-to-date**.\n\nThis is **just a warning**. If the content is still the same, you can ignore this message.", + "@product_image_outdated_explanations_content": { + "description": "Please keep the ** syntax to make the text bold" + }, "product_image_action_replace_photo": "Replace photo ({type})", "@product_image_action_replace_photo": { "description": "Action on the photo gallery to replace an existing picture", diff --git a/packages/smooth_app/lib/l10n/app_fr.arb b/packages/smooth_app/lib/l10n/app_fr.arb index 207fd4a72a6d..be2932778748 100644 --- a/packages/smooth_app/lib/l10n/app_fr.arb +++ b/packages/smooth_app/lib/l10n/app_fr.arb @@ -793,6 +793,11 @@ } }, "product_image_outdated": "Cette image peut être obsolète", + "product_image_outdated_explanations_title": "Cette image peut-être obsolète", + "product_image_outdated_explanations_content": "Cette image a été prise il y a plus d'un an.\n**Merci de vérifier qu'elle est toujours d'actualité**.\n\nIl s'agit **uniquement d'une alerte**. Si le contenu n'a pas changé, vous pouvez ignorer ce message.", + "@product_image_outdated_explanations_content": { + "description": "Please keep the ** syntax to make the text bold" + }, "product_image_action_replace_photo": "Remplacer la photo ({type})", "@product_image_action_replace_photo": { "description": "Action on the photo gallery to replace an existing picture", diff --git a/packages/smooth_app/lib/pages/product/edit_language_tabbar.dart b/packages/smooth_app/lib/pages/product/edit_language_tabbar.dart index eb42af15596c..e0505e9323b9 100644 --- a/packages/smooth_app/lib/pages/product/edit_language_tabbar.dart +++ b/packages/smooth_app/lib/pages/product/edit_language_tabbar.dart @@ -253,7 +253,7 @@ class _EditLanguageTabBarAddLanguageButton extends StatelessWidget { width: lightTheme ? 1.5 : 2.0, ), ), - color: lightTheme ? theme.primaryDark : theme.primaryNormal, + color: lightTheme ? theme.primaryBlack : theme.primaryNormal, ), child: Material( type: MaterialType.transparency, diff --git a/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_image.dart b/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_image.dart index bb7219556b08..1133e09d9954 100644 --- a/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_image.dart +++ b/packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_image.dart @@ -19,6 +19,7 @@ import 'package:smooth_app/themes/smooth_theme.dart'; import 'package:smooth_app/themes/smooth_theme_colors.dart'; import 'package:smooth_app/themes/theme_provider.dart'; import 'package:smooth_app/widgets/smooth_indicator_icon.dart'; +import 'package:smooth_app/widgets/smooth_text.dart'; class EditOCRImageWidget extends StatelessWidget { const EditOCRImageWidget({ @@ -76,14 +77,21 @@ class EditOCRImageWidget extends StatelessWidget { color: extension.warning, borderRadius: ROUNDED_BORDER_RADIUS, ), - child: const Padding( - padding: EdgeInsetsDirectional.only( - top: 6.5, - bottom: 7.5, - start: 7.0, - end: 7.0, + child: Material( + type: MaterialType.transparency, + child: InkWell( + customBorder: const CircleBorder(), + onTap: () => _openOutdatedPictureExplanations(context), + child: const Padding( + padding: EdgeInsetsDirectional.only( + top: 6.5, + bottom: 7.5, + start: 7.0, + end: 7.0, + ), + child: icons.Outdated(size: 15.0), + ), ), - child: icons.Outdated(size: 15.0), ), ), ); @@ -149,6 +157,26 @@ class EditOCRImageWidget extends StatelessWidget { ), ); } + + Future _openOutdatedPictureExplanations(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return showSmoothModalSheet( + context: context, + builder: (BuildContext context) { + return SmoothModalSheet( + title: appLocalizations.product_image_outdated_explanations_title, + prefixIndicator: true, + body: SmoothModalSheetBodyContainer( + child: TextWithBoldParts( + text: + appLocalizations.product_image_outdated_explanations_content, + ), + ), + ); + }, + ); + } } class _EditOCRImageFound extends StatelessWidget {