Skip to content

Commit 170da0e

Browse files
committed
chore: update login page icons and i18n (AppFlowy-IO#7742)
* feat: update i18n and icons * chore: replace appflowy with welcome to appflowy * fix: protenial delete page error * fix: flutter analyze
1 parent 721fff0 commit 170da0e

File tree

14 files changed

+48
-60
lines changed

14 files changed

+48
-60
lines changed

frontend/appflowy_flutter/integration_test/desktop/document/document_create_and_delete_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ void main() {
1313
await tester.initializeAppFlowy();
1414

1515
await tester.tapAnonymousSignInButton();
16+
final finder = find.text(gettingStarted, findRichText: true);
17+
await tester.pumpUntilFound(finder, timeout: const Duration(seconds: 2));
1618

1719
// create a new document
1820
const pageName = 'Test Document';

frontend/appflowy_flutter/lib/mobile/presentation/base/view_page/more_bottom_sheet.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class MobileViewPageMoreBottomSheet extends StatelessWidget {
6666
break;
6767
case MobileViewBottomSheetBodyAction.delete:
6868
context.read<ViewBloc>().add(const ViewEvent.delete());
69-
context.pop();
69+
Navigator.of(context).pop();
7070
break;
7171
case MobileViewBottomSheetBodyAction.addToFavorites:
7272
_addFavorite(context);

frontend/appflowy_flutter/lib/mobile/presentation/bottom_sheet/bottom_sheet_view_page.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
182182
),
183183
_divider(),
184184
..._buildPublishActions(context),
185-
_divider(),
185+
186186
MobileQuickActionButton(
187187
text: LocaleKeys.button_delete.tr(),
188188
textColor: Theme.of(context).colorScheme.error,
@@ -236,6 +236,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
236236
MobileViewBottomSheetBodyAction.unpublish,
237237
),
238238
),
239+
_divider(),
239240
];
240241
} else {
241242
return [
@@ -246,6 +247,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
246247
MobileViewBottomSheetBodyAction.publish,
247248
),
248249
),
250+
_divider(),
249251
];
250252
}
251253
}

frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_setting_page.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ class _MobileHomeSettingPageState extends State<MobileHomeSettingPage> {
7171
}
7272

7373
Widget _buildSettingsWidget(UserProfilePB userProfile) {
74-
// show the third-party sign in buttons if user logged in with local session and auth is enabled.
75-
76-
final isLocalAuthEnabled =
77-
userProfile.authenticator == AuthenticatorPB.Local && isAuthEnabled;
78-
'';
79-
8074
return BlocProvider(
8175
create: (context) => UserWorkspaceBloc(userProfile: userProfile)
8276
..add(const UserWorkspaceEvent.initial()),
@@ -105,7 +99,7 @@ class _MobileHomeSettingPageState extends State<MobileHomeSettingPage> {
10599
const AboutSettingGroup(),
106100
UserSessionSettingGroup(
107101
userProfile: userProfile,
108-
showThirdPartyLogin: isLocalAuthEnabled,
102+
showThirdPartyLogin: false,
109103
),
110104
const VSpace(20),
111105
],

frontend/appflowy_flutter/lib/mobile/presentation/setting/personal_info/personal_info_setting_group.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import 'package:flutter/material.dart';
2-
31
import 'package:appflowy/env/cloud_env.dart';
42
import 'package:appflowy/generated/locale_keys.g.dart';
53
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
64
import 'package:appflowy/startup/startup.dart';
75
import 'package:appflowy/workspace/application/user/prelude.dart';
86
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
97
import 'package:easy_localization/easy_localization.dart';
8+
import 'package:flutter/material.dart';
109
import 'package:flutter_bloc/flutter_bloc.dart';
1110

1211
import '../widgets/widgets.dart';
13-
1412
import 'personal_info.dart';
1513

1614
class PersonalInfoSettingGroup extends StatelessWidget {
@@ -32,7 +30,7 @@ class PersonalInfoSettingGroup extends StatelessWidget {
3230
selector: (state) => state.userProfile.name,
3331
builder: (context, userName) {
3432
return MobileSettingGroup(
35-
groupTitle: LocaleKeys.settings_mobile_personalInfo.tr(),
33+
groupTitle: LocaleKeys.settings_accountPage_title.tr(),
3634
settingItemList: [
3735
MobileSettingItem(
3836
name: userName,

frontend/appflowy_flutter/lib/user/application/sign_in_bloc.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ class SignInBloc extends Bloc<SignInEvent, SignInState> {
219219
required String email,
220220
required String passcode,
221221
}) async {
222+
if (state.isSubmitting) {
223+
Log.error('Sign in with passcode is already in progress');
224+
return;
225+
}
226+
227+
Log.info('Sign in with passcode: $email, $passcode');
228+
222229
emit(
223230
state.copyWith(
224231
isSubmitting: true,

frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/mobile_sign_in_screen.dart

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:appflowy/mobile/presentation/setting/launch_settings_page.dart';
77
import 'package:appflowy/user/application/sign_in_bloc.dart';
88
import 'package:appflowy/user/presentation/screens/sign_in_screen/widgets/anonymous_sign_in_button.dart';
99
import 'package:appflowy/user/presentation/screens/sign_in_screen/widgets/widgets.dart';
10+
import 'package:appflowy/user/presentation/widgets/flowy_logo_title.dart';
1011
import 'package:appflowy_ui/appflowy_ui.dart';
1112
import 'package:easy_localization/easy_localization.dart';
1213
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -21,34 +22,29 @@ class MobileSignInScreen extends StatelessWidget {
2122

2223
@override
2324
Widget build(BuildContext context) {
24-
const double spacing = 16;
25-
final colorScheme = Theme.of(context).colorScheme;
2625
return BlocBuilder<SignInBloc, SignInState>(
2726
builder: (context, state) {
27+
final theme = AppFlowyTheme.of(context);
2828
return Scaffold(
2929
resizeToAvoidBottomInset: false,
3030
body: Padding(
3131
padding: const EdgeInsets.symmetric(vertical: 38, horizontal: 40),
3232
child: Column(
3333
children: [
34-
const Spacer(flex: 4),
35-
_buildLogo(),
36-
const VSpace(spacing),
37-
_buildAppNameText(colorScheme),
38-
const VSpace(spacing * 2),
34+
const Spacer(),
35+
FlowyLogoTitle(title: LocaleKeys.welcomeText.tr()),
36+
VSpace(theme.spacing.xxl),
3937
isLocalAuthEnabled
4038
? const SignInAnonymousButtonV3()
4139
: const ContinueWithEmailAndPassword(),
42-
const VSpace(spacing),
43-
if (isAuthEnabled) _buildThirdPartySignInButtons(context),
44-
const VSpace(spacing * 1.5),
40+
VSpace(theme.spacing.xxl),
41+
if (isAuthEnabled) ...[
42+
_buildThirdPartySignInButtons(context),
43+
VSpace(theme.spacing.xxl),
44+
],
4545
const SignInAgreement(),
46-
const VSpace(spacing),
47-
if (!isAuthEnabled) const Spacer(flex: 2),
48-
const Spacer(flex: 2),
4946
const Spacer(),
50-
Expanded(child: _buildSettingsButton(context)),
51-
if (Platform.isAndroid) const Spacer(),
47+
_buildSettingsButton(context),
5248
],
5349
),
5450
),
@@ -57,24 +53,6 @@ class MobileSignInScreen extends StatelessWidget {
5753
);
5854
}
5955

60-
Widget _buildLogo() {
61-
return const FlowySvg(
62-
FlowySvgs.flowy_logo_xl,
63-
size: Size.square(56),
64-
blendMode: null,
65-
);
66-
}
67-
68-
Widget _buildAppNameText(ColorScheme colorScheme) {
69-
return FlowyText(
70-
LocaleKeys.appName.tr(),
71-
textAlign: TextAlign.center,
72-
fontSize: 28,
73-
color: const Color(0xFF00BCF0),
74-
fontWeight: FontWeight.w700,
75-
);
76-
}
77-
7856
Widget _buildThirdPartySignInButtons(BuildContext context) {
7957
final theme = AppFlowyTheme.of(context);
8058
return Column(

frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/anonymous_sign_in_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SignInAnonymousButtonV3 extends StatelessWidget {
2929
},
3030
child: BlocBuilder<AnonUserBloc, AnonUserState>(
3131
builder: (context, state) {
32-
final text = LocaleKeys.signUp_getStartedText.tr();
32+
final text = LocaleKeys.signIn_continueWithLocalModel.tr();
3333
final onTap = state.anonUsers.isEmpty
3434
? () {
3535
context

frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_email_and_password.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ class _ContinueWithEmailAndPasswordState
131131

132132
_hasPushedContinueWithMagicLinkOrPasscodePage = false;
133133
},
134-
onEnterPasscode: (passcode) => signInBloc.add(
135-
SignInEvent.signInWithPasscode(
136-
email: email,
137-
passcode: passcode,
138-
),
139-
),
134+
onEnterPasscode: (passcode) {
135+
signInBloc.add(
136+
SignInEvent.signInWithPasscode(
137+
email: email,
138+
passcode: passcode,
139+
),
140+
);
141+
},
140142
),
141143
),
142144
),

frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/sign_in_agreement.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:appflowy/core/helpers/url_launcher.dart';
2-
import 'package:appflowy/env/cloud_env.dart';
32
import 'package:appflowy/generated/locale_keys.g.dart';
43
import 'package:appflowy_ui/appflowy_ui.dart';
54
import 'package:easy_localization/easy_localization.dart';
@@ -25,9 +24,7 @@ class SignInAgreement extends StatelessWidget {
2524
text: TextSpan(
2625
children: [
2726
TextSpan(
28-
text: isLocalAuthEnabled
29-
? LocaleKeys.web_signInLocalAgreement.tr()
30-
: LocaleKeys.web_signInAgreement.tr(),
27+
text: LocaleKeys.web_signInAgreement.tr(),
3128
style: textStyle,
3229
),
3330
TextSpan(

0 commit comments

Comments
 (0)