Skip to content

Commit

Permalink
Outdated explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jan 10, 2025
1 parent 9d28fa8 commit 4f7c2fb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
5 changes: 5 additions & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions packages/smooth_app/lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
42 changes: 35 additions & 7 deletions packages/smooth_app/lib/pages/product/edit_ocr/edit_ocr_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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),
),
),
);
Expand Down Expand Up @@ -149,6 +157,26 @@ class EditOCRImageWidget extends StatelessWidget {
),
);
}

Future<void> _openOutdatedPictureExplanations(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context);

return showSmoothModalSheet<void>(
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 {
Expand Down

0 comments on commit 4f7c2fb

Please sign in to comment.