Skip to content

Commit

Permalink
Update new twake welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed Jan 24, 2024
1 parent 3eab82b commit bdda972
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 114 deletions.
2 changes: 1 addition & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2980,7 +2980,7 @@
"signIn": "Sign in",
"createTwakeId": "Create Twake ID",
"useYourCompanyServer": "Use your company server",
"descriptionTwakeId": "To start, please create a TwakeID \nthat will allow you to use \nchat, mail and drive",
"descriptionTwakeId": "An open source messenger encrypt\nyour data with matrix protocol",
"countFilesSendPerDialog": "The maximum files when sending is {count}.",
"sendFiles": "Send {count} files",
"failedToSendFiles": "Failed to send files",
Expand Down
11 changes: 5 additions & 6 deletions lib/config/go_routes/go_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:fluffychat/pages/chat_draft/draft_chat_adaptive_scaffold.dart';
import 'package:fluffychat/pages/chat_encryption_settings/chat_encryption_settings.dart';
import 'package:fluffychat/pages/error_page/error_page.dart';
import 'package:fluffychat/pages/homeserver_picker/homeserver_picker.dart';
import 'package:fluffychat/pages/twake_id/twake_id.dart';
import 'package:fluffychat/pages/new_group/new_group_chat_info.dart';
import 'package:fluffychat/pages/settings_dashboard/settings_app_language/settings_app_language.dart';
import 'package:fluffychat/pages/settings_dashboard/settings_profile/settings_profile.dart';
Expand Down Expand Up @@ -60,7 +59,7 @@ abstract class AppRoutes {
BuildContext context,
GoRouterState state,
) =>
Matrix.of(context).client.isLogged() ? null : '/home/twakeid';
Matrix.of(context).client.isLogged() ? null : '/home/twakeWelcome';

AppRoutes();

Expand Down Expand Up @@ -91,10 +90,10 @@ abstract class AppRoutes {
redirect: loggedInRedirect,
),
GoRoute(
path: 'twakeid',
path: 'twakeWelcome',
pageBuilder: (context, state) => defaultPageBuilder(
context,
const TwakeId(),
const TwakeWelcome(),
),
redirect: loggedInRedirect,
),
Expand Down Expand Up @@ -365,10 +364,10 @@ abstract class AppRoutes {
redirect: loggedOutRedirect,
),
GoRoute(
path: 'twakeid',
path: 'twakeWelcome',
pageBuilder: (context, state) => defaultPageBuilder(
context,
const TwakeId(),
const TwakeWelcome(),
),
redirect: loggedInRedirect,
),
Expand Down
21 changes: 0 additions & 21 deletions lib/pages/twake_id/twake_id.dart

This file was deleted.

35 changes: 0 additions & 35 deletions lib/pages/twake_id/twake_id_view.dart

This file was deleted.

8 changes: 3 additions & 5 deletions lib/pages/twake_welcome/twake_welcome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ class TwakeWelcome extends StatefulWidget {
}

class TwakeWelcomeController extends State<TwakeWelcome> {
void goToTwakeIdScreen() {
context.push('/home/twakeid');
void goToHomeserverPicker() {
context.push('/home/homeserverpicker');
}

@override
Widget build(BuildContext context) {
return TwakeWelcomeView(
controller: this,
);
return TwakeWelcomeView(controller: this);
}
}
39 changes: 10 additions & 29 deletions lib/pages/twake_welcome/twake_welcome_view.dart
Original file line number Diff line number Diff line change
@@ -1,50 +1,31 @@
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pages/twake_welcome/twake_welcome.dart';
import 'package:fluffychat/pages/twake_welcome/twake_welcome_view_style.dart';
import 'package:fluffychat/resource/image_paths.dart';
import 'package:fluffychat/utils/url_launcher.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:linagora_design_flutter/colors/linagora_sys_colors.dart';
import 'package:linagora_design_flutter/twake_screen/twake_welcome_screen.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:linagora_design_flutter/linagora_design_flutter.dart';

class TwakeWelcomeView extends StatelessWidget {
final TwakeWelcomeController controller;

const TwakeWelcomeView({
super.key,
required this.controller,
});
const TwakeWelcomeView({super.key, required this.controller});

@override
Widget build(BuildContext context) {
return TwakeWelcomeScreen(
welcomeTo: L10n.of(context)!.welcomeTo,
welcomeToStyle: Theme.of(context).textTheme.headlineLarge?.copyWith(
color: LinagoraSysColors.material().onSurfaceVariant,
),
descriptionWelcomeTo: L10n.of(context)!.descriptionWelcomeTo,
descriptionWelcomeToStyle:
Theme.of(context).textTheme.bodyLarge?.copyWith(
color: LinagoraSysColors.material().onSurfaceVariant,
),
titleStartMessaging: L10n.of(context)!.startMessaging,
titleStartMessagingStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: LinagoraSysColors.material().onPrimary,
),
titlePrivacy: L10n.of(context)!.privacy,
privacyTextStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
color: LinagoraSysColors.material().primary,
),
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
overlayColor: MaterialStateProperty.all(Colors.transparent),
useCompanyServerTitle: L10n.of(context)!.useYourCompanyServer,
description: L10n.of(context)!.descriptionTwakeId,
onUseCompanyServerOnTap: controller.goToHomeserverPicker,
logo: SvgPicture.asset(
ImagePaths.logoTwakeWelcome,
width: TwakeWelcomeViewStyle.logoWidth,
height: TwakeWelcomeViewStyle.logoHeight,
),
buttonOnTap: controller.goToTwakeIdScreen,
privacyOnTap: () =>
UrlLauncher(context, url: AppConfig.privacyUrl).openUrlInAppBrowser(),
);
}
}
17 changes: 2 additions & 15 deletions lib/pages/twake_welcome/twake_welcome_view_style.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import 'package:flutter/material.dart';

class TwakeWelcomeViewStyle {
static const double logoWidth = 257;
static const double logoHeight = 179;

static const double buttonHeight = 56;

static const double buttonRadius = 100;

static const EdgeInsets descriptionPadding =
EdgeInsets.symmetric(horizontal: 8);

static const EdgeInsets buttonPadding = EdgeInsets.only(
bottom: 44,
);
static const double logoWidth = 225;
static const double logoHeight = 147;
}
2 changes: 1 addition & 1 deletion lib/widgets/matrix.dart
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class MatrixState extends State<Matrix>
} else {
Logs().v('[MATRIX] Log out successful');
if (PlatformInfos.isMobile) {
TwakeApp.router.go('/home/twakeid');
TwakeApp.router.go('/home/twakeWelcome');
} else {
TwakeApp.router.go('/home');
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ packages:
description:
path: "."
ref: master
resolved-ref: f3371287c4f66e2cff23a8c5d8aaf30aa3b7bf6b
resolved-ref: ea9d98ed3bab8f362a46cb0d48ff57eb1332630c
url: "[email protected]:linagora/linagora-design-flutter.git"
source: git
version: "0.0.1"
Expand Down

0 comments on commit bdda972

Please sign in to comment.