Skip to content

armgit / ente

Public Imported from GitHub
0

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

update on ente empty state

AmanRajSinghMouryaf70d2e00c118
diff --git a/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart b/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart
index ff883fb74a..e914490ab1 100644
--- a/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart
+++ b/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart
@@ -1,6 +1,8 @@
import "package:flutter/material.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/collection/collection.dart";
import "package:photos/theme/ente_theme.dart";
+import "package:photos/ui/home/landing_page_widget.dart";
class EmptyOnEnteSection extends StatelessWidget {
final List<Collection> collections;
@@ -13,70 +15,75 @@ class EmptyOnEnteSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
- final sampleNames = collections
- .map((collection) => collection.displayName)
- .where((name) => name.isNotEmpty)
- .take(3)
- .toList();
- final countText = "You have ${collections.length} album"
- "${collections.length == 1 ? "" : "s"} on Ente.";
+ final l10n = AppLocalizations.of(context);
- return Container(
- width: double.infinity,
- margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: colorScheme.fillFaint,
- borderRadius: BorderRadius.circular(12),
- border: Border.all(color: colorScheme.strokeFaint),
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- "Offline mode",
- style: textTheme.smallBold.copyWith(color: colorScheme.textMuted),
- ),
- const SizedBox(height: 8),
- Text(
- countText,
- style: textTheme.body.copyWith(color: colorScheme.textBase),
- ),
- const SizedBox(height: 6),
- Text(
- "Sign in to view and manage albums stored on Ente.",
- style: textTheme.small.copyWith(color: colorScheme.textMuted),
- ),
- if (sampleNames.isNotEmpty) ...[
- const SizedBox(height: 12),
- Wrap(
- spacing: 6,
- runSpacing: 6,
- children: sampleNames
- .map(
- (name) => Container(
- padding: const EdgeInsets.symmetric(
- horizontal: 10,
- vertical: 6,
- ),
- decoration: BoxDecoration(
- color: colorScheme.fillBase,
- borderRadius: BorderRadius.circular(999),
- border: Border.all(color: colorScheme.strokeFaint),
- ),
- child: Text(
- name,
- style: textTheme.mini.copyWith(
- color: colorScheme.textMuted,
- ),
- ),
- ),
- )
- .toList(),
+ return Padding(
+ padding: const EdgeInsets.all(12),
+ child: Container(
+ height: 156,
+ width: double.infinity,
+ padding: const EdgeInsets.symmetric(vertical: 24),
+ decoration: BoxDecoration(
+ color: colorScheme.backgroundElevated,
+ borderRadius: BorderRadius.circular(20),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ l10n.offlineEnableBackupTitle,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontFamily: "Nunito",
+ fontWeight: FontWeight.w800,
+ fontSize: 16,
+ height: 20 / 16,
+ letterSpacing: -1.0,
+ color: colorScheme.textBase,
+ ),
+ ),
+ const SizedBox(height: 8),
+ Text(
+ l10n.offlineEnableBackupDesc,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontFamily: "Inter",
+ fontWeight: FontWeight.w500,
+ fontSize: 10,
+ height: 16 / 10,
+ color: colorScheme.textBase.withValues(alpha: 0.6),
+ ),
+ ),
+ const SizedBox(height: 16),
+ GestureDetector(
+ onTap: () {
+ Navigator.of(context).push(
+ MaterialPageRoute(
+ builder: (_) => const LandingPageWidget(),
+ ),
+ );
+ },
+ child: Container(
+ height: 36,
+ decoration: BoxDecoration(
+ color: getEnteColorScheme(context).greenBase,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ alignment: Alignment.center,
+ child: const Text(
+ "Start with 10 GB FREE",
+ style: TextStyle(
+ fontFamily: "Montserrat",
+ fontWeight: FontWeight.w600,
+ fontSize: 10,
+ height: 12 / 10,
+ color: Colors.white,
+ ),
+ ),
+ ),
),
],
- ],
+ ),
),
);
}