diff --git a/lib/authentication/view/authentication_page.dart b/lib/authentication/view/authentication_page.dart index d023f5e..e7e26b7 100644 --- a/lib/authentication/view/authentication_page.dart +++ b/lib/authentication/view/authentication_page.dart @@ -10,28 +10,14 @@ import 'package:ht_dashboard/router/routes.dart'; import 'package:ht_dashboard/shared/constants/app_spacing.dart'; /// {@template authentication_page} -/// Displays authentication options (Google, Email, Anonymous) based on context. +/// Displays authentication options for the dashboard. /// -/// This page can be used for both initial sign-in and for connecting an -/// existing anonymous account. +/// This page provides a secure sign-in method for administrators and +/// publishers via email. /// {@endtemplate} class AuthenticationPage extends StatelessWidget { /// {@macro authentication_page} - const AuthenticationPage({ - required this.headline, - required this.subHeadline, - required this.showAnonymousButton, - super.key, - }); - - /// The main title displayed on the page. - final String headline; - - /// The descriptive text displayed below the headline. - final String subHeadline; - - /// Whether to show the "Continue Anonymously" button. - final bool showAnonymousButton; + const AuthenticationPage({super.key}); @override Widget build(BuildContext context) { @@ -88,7 +74,7 @@ class AuthenticationPage extends StatelessWidget { // const SizedBox(height: AppSpacing.lg), // --- Headline and Subheadline --- Text( - headline, + l10n.authenticationPageHeadline, style: textTheme.headlineMedium?.copyWith( fontWeight: FontWeight.bold, ), @@ -96,7 +82,7 @@ class AuthenticationPage extends StatelessWidget { ), const SizedBox(height: AppSpacing.md), Text( - subHeadline, + l10n.authenticationPageSubheadline, style: textTheme.bodyLarge?.copyWith( color: colorScheme.onSurfaceVariant, ), diff --git a/lib/authentication/view/request_code_page.dart b/lib/authentication/view/request_code_page.dart index 36722cb..e5dde0e 100644 --- a/lib/authentication/view/request_code_page.dart +++ b/lib/authentication/view/request_code_page.dart @@ -3,9 +3,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:go_router/go_router.dart'; import 'package:ht_dashboard/app/bloc/app_bloc.dart'; import 'package:ht_dashboard/app/config/config.dart'; -import 'package:go_router/go_router.dart'; import 'package:ht_dashboard/authentication/bloc/authentication_bloc.dart'; import 'package:ht_dashboard/l10n/l10n.dart'; import 'package:ht_dashboard/router/routes.dart'; @@ -137,7 +137,9 @@ class _RequestCodeView extends StatelessWidget { builder: (context, environment) { if (environment == AppEnvironment.demo) { return Padding( - padding: const EdgeInsets.only(top: AppSpacing.lg), + padding: const EdgeInsets.only( + top: AppSpacing.lg, + ), child: Text( l10n.demoEmailHint('admin@example.com'), style: textTheme.bodyMedium?.copyWith( diff --git a/lib/content_management/view/create_category_page.dart b/lib/content_management/view/create_category_page.dart index 49e1af9..bb54621 100644 --- a/lib/content_management/view/create_category_page.dart +++ b/lib/content_management/view/create_category_page.dart @@ -82,8 +82,8 @@ class _CreateCategoryViewState extends State<_CreateCategoryView> { SnackBar(content: Text(l10n.categoryCreatedSuccessfully)), ); context.read().add( - // Refresh the list to show the new category - const LoadCategoriesRequested(limit: kDefaultRowsPerPage), + // Refresh the list to show the new category + const LoadCategoriesRequested(limit: kDefaultRowsPerPage), ); context.pop(); } diff --git a/lib/content_management/view/create_headline_page.dart b/lib/content_management/view/create_headline_page.dart index 9ce98b8..1c5cc19 100644 --- a/lib/content_management/view/create_headline_page.dart +++ b/lib/content_management/view/create_headline_page.dart @@ -84,8 +84,8 @@ class _CreateHeadlineViewState extends State<_CreateHeadlineView> { SnackBar(content: Text(l10n.headlineCreatedSuccessfully)), ); context.read().add( - // Refresh the list to show the new headline - const LoadHeadlinesRequested(limit: kDefaultRowsPerPage), + // Refresh the list to show the new headline + const LoadHeadlinesRequested(limit: kDefaultRowsPerPage), ); context.pop(); } diff --git a/lib/content_management/view/create_source_page.dart b/lib/content_management/view/create_source_page.dart index 7876654..80596a6 100644 --- a/lib/content_management/view/create_source_page.dart +++ b/lib/content_management/view/create_source_page.dart @@ -84,8 +84,8 @@ class _CreateSourceViewState extends State<_CreateSourceView> { SnackBar(content: Text(l10n.sourceCreatedSuccessfully)), ); context.read().add( - // Refresh the list to show the new source - const LoadSourcesRequested(limit: kDefaultRowsPerPage), + // Refresh the list to show the new source + const LoadSourcesRequested(limit: kDefaultRowsPerPage), ); context.pop(); } diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index c736cab..8d32254 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -104,6 +104,18 @@ abstract class AppLocalizations { /// **'Hello World!'** String get helloWorld; + /// Headline for the main authentication page + /// + /// In en, this message translates to: + /// **'Dashboard Access'** + String get authenticationPageHeadline; + + /// Subheadline for the main authentication page + /// + /// In en, this message translates to: + /// **'Secure sign-in for administrators and publishers.'** + String get authenticationPageSubheadline; + /// Button label for signing in with email /// /// In en, this message translates to: @@ -113,19 +125,19 @@ abstract class AppLocalizations { /// Title for the email sign-in page /// /// In en, this message translates to: - /// **'Email Sign In'** + /// **'Secure Email Sign-In'** String get emailSignInPageTitle; /// Headline for the request code page /// /// In en, this message translates to: - /// **'Sign in or create an account'** + /// **'Secure Email Sign-In'** String get requestCodePageHeadline; /// Subheadline for the request code page /// /// In en, this message translates to: - /// **'Enter your email to receive a verification code. No password needed!'** + /// **'Enter your authorized email to receive a secure sign-in code.'** String get requestCodePageSubheadline; /// Label for the email input field on the request code page diff --git a/lib/l10n/app_localizations_ar.dart b/lib/l10n/app_localizations_ar.dart index 2923918..fdcbfbc 100644 --- a/lib/l10n/app_localizations_ar.dart +++ b/lib/l10n/app_localizations_ar.dart @@ -11,19 +11,26 @@ class AppLocalizationsAr extends AppLocalizations { @override String get helloWorld => 'مرحبا بالعالم!'; + @override + String get authenticationPageHeadline => 'الوصول إلى لوحة التحكم'; + + @override + String get authenticationPageSubheadline => + 'تسجيل دخول آمن للمسؤولين والناشرين.'; + @override String get authenticationEmailSignInButton => 'تسجيل الدخول بالبريد الإلكتروني'; @override - String get emailSignInPageTitle => 'تسجيل الدخول بالبريد الإلكتروني'; + String get emailSignInPageTitle => 'تسجيل دخول آمن بالبريد الإلكتروني'; @override - String get requestCodePageHeadline => 'سجل الدخول أو أنشئ حسابًا'; + String get requestCodePageHeadline => 'تسجيل دخول آمن بالبريد الإلكتروني'; @override String get requestCodePageSubheadline => - 'أدخل بريدك الإلكتروني لتلقي رمز التحقق. لا حاجة لكلمة مرور!'; + 'أدخل بريدك الإلكتروني المعتمد لتلقي رمز تسجيل دخول آمن.'; @override String get requestCodeEmailLabel => 'البريد الإلكتروني'; diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index d9a4e30..2bf1ee6 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -11,18 +11,25 @@ class AppLocalizationsEn extends AppLocalizations { @override String get helloWorld => 'Hello World!'; + @override + String get authenticationPageHeadline => 'Dashboard Access'; + + @override + String get authenticationPageSubheadline => + 'Secure sign-in for administrators and publishers.'; + @override String get authenticationEmailSignInButton => 'Sign in with Email'; @override - String get emailSignInPageTitle => 'Email Sign In'; + String get emailSignInPageTitle => 'Secure Email Sign-In'; @override - String get requestCodePageHeadline => 'Sign in or create an account'; + String get requestCodePageHeadline => 'Secure Email Sign-In'; @override String get requestCodePageSubheadline => - 'Enter your email to receive a verification code. No password needed!'; + 'Enter your authorized email to receive a secure sign-in code.'; @override String get requestCodeEmailLabel => 'Email'; diff --git a/lib/l10n/arb/app_ar.arb b/lib/l10n/arb/app_ar.arb index 2ae6fa0..66f7935 100644 --- a/lib/l10n/arb/app_ar.arb +++ b/lib/l10n/arb/app_ar.arb @@ -3,19 +3,27 @@ "@helloWorld": { "description": "التحية التقليدية للمبرمج حديث الولادة" }, + "authenticationPageHeadline": "الوصول إلى لوحة التحكم", + "@authenticationPageHeadline": { + "description": "عنوان صفحة المصادقة الرئيسية" + }, + "authenticationPageSubheadline": "تسجيل دخول آمن للمسؤولين والناشرين.", + "@authenticationPageSubheadline": { + "description": "عنوان فرعي لصفحة المصادقة الرئيسية" + }, "authenticationEmailSignInButton": "تسجيل الدخول بالبريد الإلكتروني", "@authenticationEmailSignInButton": { "description": "زر تسجيل الدخول بالبريد الإلكتروني" }, - "emailSignInPageTitle": "تسجيل الدخول بالبريد الإلكتروني", + "emailSignInPageTitle": "تسجيل دخول آمن بالبريد الإلكتروني", "@emailSignInPageTitle": { "description": "عنوان صفحة تسجيل الدخول بالبريد الإلكتروني" }, - "requestCodePageHeadline": "سجل الدخول أو أنشئ حسابًا", + "requestCodePageHeadline": "تسجيل دخول آمن بالبريد الإلكتروني", "@requestCodePageHeadline": { "description": "عنوان صفحة طلب الرمز" }, - "requestCodePageSubheadline": "أدخل بريدك الإلكتروني لتلقي رمز التحقق. لا حاجة لكلمة مرور!", + "requestCodePageSubheadline": "أدخل بريدك الإلكتروني المعتمد لتلقي رمز تسجيل دخول آمن.", "@requestCodePageSubheadline": { "description": "عنوان فرعي لصفحة طلب الرمز" }, diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index e3b0732..d423deb 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -3,19 +3,27 @@ "@helloWorld": { "description": "The conventional newborn programmer greeting" }, + "authenticationPageHeadline": "Dashboard Access", + "@authenticationPageHeadline": { + "description": "Headline for the main authentication page" + }, + "authenticationPageSubheadline": "Secure sign-in for administrators and publishers.", + "@authenticationPageSubheadline": { + "description": "Subheadline for the main authentication page" + }, "authenticationEmailSignInButton": "Sign in with Email", "@authenticationEmailSignInButton": { "description": "Button label for signing in with email" }, - "emailSignInPageTitle": "Email Sign In", + "emailSignInPageTitle": "Secure Email Sign-In", "@emailSignInPageTitle": { "description": "Title for the email sign-in page" }, - "requestCodePageHeadline": "Sign in or create an account", + "requestCodePageHeadline": "Secure Email Sign-In", "@requestCodePageHeadline": { "description": "Headline for the request code page" }, - "requestCodePageSubheadline": "Enter your email to receive a verification code. No password needed!", + "requestCodePageSubheadline": "Enter your authorized email to receive a secure sign-in code.", "@requestCodePageSubheadline": { "description": "Subheadline for the request code page" }, diff --git a/lib/router/router.dart b/lib/router/router.dart index e00fe2b..1cb6b38 100644 --- a/lib/router/router.dart +++ b/lib/router/router.dart @@ -97,19 +97,11 @@ GoRouter createRouter({ path: Routes.authentication, name: Routes.authenticationName, builder: (BuildContext context, GoRouterState state) { - const headline = 'Sign In to Dashboard'; - const subHeadline = 'Enter your email to get a verification code.'; - const showAnonymousButton = false; - return BlocProvider( create: (context) => AuthenticationBloc( authenticationRepository: context.read(), ), - child: const AuthenticationPage( - headline: headline, - subHeadline: subHeadline, - showAnonymousButton: showAnonymousButton, - ), + child: const AuthenticationPage(), ); }, routes: [