Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

update email action sheet

AmanRajSinghMourya599a28b70282
diff --git a/mobile/apps/photos/lib/emergency/components/email_action_sheet.dart b/mobile/apps/photos/lib/emergency/components/email_action_sheet.dart
new file mode 100644
index 0000000000..a19ece79d0
--- /dev/null
+++ b/mobile/apps/photos/lib/emergency/components/email_action_sheet.dart
@@ -0,0 +1,58 @@
+import "package:flutter/material.dart";
+import "package:photos/theme/ente_theme.dart";
+import "package:photos/ui/components/base_bottom_sheet.dart";
+
+Future<T?> showEmailActionSheet<T>(
+ BuildContext context, {
+ required String email,
+ required String message,
+ required List<Widget> buttons,
+ String? title,
+}) {
+ return showBaseBottomSheet<T>(
+ context,
+ title: title ?? email,
+ headerSpacing: 20,
+ padding: const EdgeInsets.all(16),
+ backgroundColor: getEnteColorScheme(context).backgroundColour,
+ child: EmailActionSheetContent(
+ message: message,
+ buttons: buttons,
+ ),
+ );
+}
+
+class EmailActionSheetContent extends StatelessWidget {
+ final String message;
+ final List<Widget> buttons;
+
+ const EmailActionSheetContent({
+ required this.message,
+ required this.buttons,
+ super.key,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final textTheme = getEnteTextTheme(context);
+ final colorScheme = getEnteColorScheme(context);
+
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ message,
+ style: textTheme.small.copyWith(color: colorScheme.textMuted),
+ ),
+ const SizedBox(height: 20),
+ ListView.separated(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: buttons.length,
+ separatorBuilder: (_, __) => const SizedBox(height: 12),
+ itemBuilder: (_, index) => buttons[index],
+ ),
+ ],
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/emergency/emergency_page.dart b/mobile/apps/photos/lib/emergency/emergency_page.dart
index 2c7390c1cb..0223f4bb1e 100644
--- a/mobile/apps/photos/lib/emergency/emergency_page.dart
+++ b/mobile/apps/photos/lib/emergency/emergency_page.dart
@@ -576,7 +576,7 @@ class _WarningBanner extends StatelessWidget {
final textTheme = getEnteTextTheme(context);
return Container(
- padding: const EdgeInsets.all(18),
+ padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: colorScheme.warning400.withValues(alpha: 0.13),
borderRadius: BorderRadius.circular(20),