Skip to content

Commit

Permalink
feat(sks-menu): add offline menu viewing note alert
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-the-shark committed Dec 9, 2024
1 parent 8efbf20 commit 07737e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Future<ExtendedSksMenuResponse> getSksMenuData(Ref ref) async {
meals: trueMeals,
technicalInfos: [
...technicalInfos,
"DZISIAJ BĘDZIE CZYNNE DO 14:00 !!!?!?",
],
);
}
8 changes: 7 additions & 1 deletion lib/features/sks-menu/presentation/sks_menu_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ class _SksMenuView extends StatelessWidget {
),
body: ListView(
children: [
if (!sksMenuData.isMenuOnline)
TechnicalMessage(
color: context.colorTheme.blueAzure,
title: context.localize.sks_note,
message: context.localize.sks_menu_you_see_last_menu,
),
for (final technicalInfo in sksMenuData.technicalInfos)
TechnicalMessage(message: technicalInfo),
SksMenuHeader(
Expand Down Expand Up @@ -115,7 +121,7 @@ class _SKSMenuLottieAnimation extends HookWidget {
final animationSize = MediaQuery.sizeOf(context).width * 0.6;

return Scaffold(
backgroundColor: context.colorTheme.greyLight,
backgroundColor: context.colorTheme.whiteSoap,
appBar: DetailViewAppBar(
actions: const [
SksUserDataButton(),
Expand Down
13 changes: 10 additions & 3 deletions lib/features/sks-menu/presentation/widgets/technical_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import "../../../../theme/app_theme.dart";
import "../../data/models/dish_category_enum.dart";

class TechnicalMessage extends StatelessWidget {
const TechnicalMessage({super.key, required this.message});
const TechnicalMessage({
super.key,
required this.message,
this.title,
this.color,
});
final String message;
final String? title;
final Color? color;
@override
Widget build(BuildContext context) {
return Padding(
Expand All @@ -16,10 +23,10 @@ class TechnicalMessage extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: ColoredBox(
color: context.colorTheme.orangePomegranade,
color: color ?? context.colorTheme.orangePomegranade,
child: ListTile(
title: Text(
DishCategory.technicalInfo.getLocalizedName(context),
title ?? DishCategory.technicalInfo.getLocalizedName(context),
style: context.textTheme.titleWhite,
),
subtitle: Text(
Expand Down
4 changes: 3 additions & 1 deletion lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,7 @@
"sks_show_last_menu" : "Pokaż ostatnio dostępne menu",
"confirm": "Zatwierdź",
"push_notifications_dialog_info": "Obecnie nie korzystamy z powiadomień push, ale planujemy dodać je w przyszłości. Możesz wyrazić na nie zgodę już teraz.",
"sks_menu_technical_info": "KOMUNIKAT"
"sks_menu_technical_info": "KOMUNIKAT",
"sks_note": "UWAGA",
"sks_menu_you_see_last_menu": "Aktualne menu SKS jest niedostępne. Przeglądasz ostatnio dostępną wersję."
}

0 comments on commit 07737e3

Please sign in to comment.