Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] Replace changelog gift with Locker link

r4khul46a6de4341b0
diff --git a/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart b/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart
index b9586b295f..e2b49631c7 100644
--- a/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart
+++ b/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart
@@ -6,8 +6,14 @@ import "package:photos/service_locator.dart";
import "package:photos/services/review_service.dart";
import 'package:photos/ui/notification/update/change_log_entry.dart';
import 'package:photos/ui/notification/update/change_log_strings.dart';
+import 'package:url_launcher/url_launcher_string.dart';
-enum ChangeLogPageAction { openReferrals }
+Future<void> showChangeLogSheet(BuildContext context) async {
+ await showBottomSheetComponent<void>(
+ context: context,
+ builder: (context) => const ChangeLogPage(),
+ );
+}
class ChangeLogPage extends StatefulWidget {
const ChangeLogPage({super.key});
@@ -47,25 +53,40 @@ class _ChangeLogPageState extends State<ChangeLogPage> {
}
},
),
- ButtonComponent(
- variant: ButtonComponentVariant.secondary,
- size: ButtonComponentSize.large,
- label: isLocalGallery ? l10n.rateUs : 'Gift 10 GB',
- leading: isLocalGallery
- ? Icon(Icons.favorite_rounded, color: colors.primary)
- : HugeIcon(
- icon: HugeIcons.strokeRoundedGift,
- color: colors.textBase,
- size: IconSizes.small,
+ Theme(
+ data: Theme.of(context).copyWith(
+ extensions: [
+ ComponentColorTokens(
+ ComponentTheme.colorsForApp(
+ ComponentApp.locker,
+ brightness: Theme.of(context).brightness,
),
- shouldSurfaceExecutionStates: false,
- onTap: () async {
- if (isLocalGallery) {
- await ReviewService.launch();
- } else if (Navigator.of(context).canPop()) {
- Navigator.of(context).pop(ChangeLogPageAction.openReferrals);
- }
- },
+ ),
+ ],
+ ),
+ child: ButtonComponent(
+ variant: isLocalGallery
+ ? ButtonComponentVariant.secondary
+ : ButtonComponentVariant.primary,
+ size: ButtonComponentSize.large,
+ label: isLocalGallery ? l10n.rateUs : l10n.meetEnteLocker,
+ leading: isLocalGallery
+ ? Icon(Icons.favorite_rounded, color: colors.primary)
+ : const EnteAppIcon(app: ComponentApp.locker),
+ shouldSurfaceExecutionStates: false,
+ onTap: () async {
+ if (isLocalGallery) {
+ await ReviewService.launch();
+ } else {
+ final navigator = Navigator.of(context);
+ if (navigator.canPop()) navigator.pop();
+ await launchUrlString(
+ 'https://ente.com/locker/get',
+ mode: LaunchMode.externalApplication,
+ );
+ }
+ },
+ ),
),
],
);
diff --git a/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart b/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart
index 1d93ccd543..61beba5f88 100644
--- a/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/debug/debug_settings_page.dart
@@ -1,4 +1,3 @@
-import "package:ente_components/ente_components.dart";
import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
import "package:photos/core/event_bus.dart";
@@ -8,7 +7,6 @@ import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/components/menu_item_widget/menu_item_widget_new.dart";
import "package:photos/ui/components/settings/settings_grouped_card.dart";
import "package:photos/ui/components/toggle_switch_widget.dart";
-import "package:photos/ui/growth/referral_screen.dart";
import "package:photos/ui/home/christmas/christmas_utils.dart";
import "package:photos/ui/notification/toast.dart";
import "package:photos/ui/notification/update/change_log_page.dart";
@@ -198,21 +196,7 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
onTap: () async {
- final action =
- await showBottomSheetComponent<
- ChangeLogPageAction
- >(
- context: context,
- builder: (context) => const ChangeLogPage(),
- );
- if (!context.mounted ||
- action != ChangeLogPageAction.openReferrals) {
- return;
- }
- await openReferralScreen(
- context,
- showLoadingDialog: true,
- );
+ await showChangeLogSheet(context);
},
),
MenuItemWidgetNew(
diff --git a/mobile/apps/photos/lib/ui/tabs/home_widget.dart b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
index 0673316b29..4e377e2f5e 100644
--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart
+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
@@ -3,7 +3,6 @@ import "dart:convert";
import "dart:io";
import "package:app_links/app_links.dart";
-import "package:ente_components/ente_components.dart";
import "package:ente_crypto/ente_crypto.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:ente_strings/ente_strings.dart";
@@ -60,7 +59,6 @@ import "package:photos/ui/collections/collection_action_sheet.dart";
import "package:photos/ui/components/buttons/button_widget.dart";
import "package:photos/ui/components/models/button_type.dart";
import "package:photos/ui/extents_page_view.dart";
-import "package:photos/ui/growth/referral_screen.dart";
import "package:photos/ui/home/christmas/christmas_pull_animation.dart";
import "package:photos/ui/home/christmas/christmas_utils.dart";
import "package:photos/ui/home/christmas/snow_fall_overlay.dart";
@@ -1241,18 +1239,8 @@ class _HomeWidgetState extends State<HomeWidget> {
return;
}
if (!context.mounted) return;
- final sheetAction = await showBottomSheetComponent<ChangeLogPageAction>(
- context: context,
- builder: (context) => const ChangeLogPage(),
- );
+ await showChangeLogSheet(context);
await updateService.hideChangeLog();
- if (!mounted) {
- return;
- }
- if (sheetAction == ChangeLogPageAction.openReferrals) {
- if (!context.mounted) return;
- await openReferralScreen(context, showLoadingDialog: true);
- }
} finally {
_isShowingChangeLog = false;
}
diff --git a/mobile/packages/strings/lib/l10n/arb/strings_en.arb b/mobile/packages/strings/lib/l10n/arb/strings_en.arb
index 9cbfb6e6b2..3bcdf0c4ea 100644
--- a/mobile/packages/strings/lib/l10n/arb/strings_en.arb
+++ b/mobile/packages/strings/lib/l10n/arb/strings_en.arb
@@ -2519,6 +2519,10 @@
"@mediaManagementHintTitle": {
"description": "Title of a sheet prompting Android users to enable media management permission."
},
+ "meetEnteLocker": "Meet Ente Locker",
+ "@meetEnteLocker": {
+ "description": "Button in the Photos changelog that opens the Ente Locker website"
+ },
"members": "Members",
"memberStorageUsed": "{amount} used",
"@memberStorageUsed": {