This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 5975617d090 [Tour of Beam] [Frontend] Module complexity on the welcome 
screen (#26541)
5975617d090 is described below

commit 5975617d09067d66fd520dca5009a9dcae0d9879
Author: Darkhan Nausharipov <31556582+naushari...@users.noreply.github.com>
AuthorDate: Thu May 4 19:16:15 2023 +0600

    [Tour of Beam] [Frontend] Module complexity on the welcome screen (#26541)
    
    * complexity in the welcome screen
    
(https://github.com/akvelon/beam/commit/7d0ce2c4f0b3f2c3638ba0edc8d6196b0063fe19)
    
    * a comment to relaunch CI
    
    * deleted a comment to relaunch CI
    
    * _HomepageLinkLogo
    
    * popUntilBottom
    
    ---------
    
    Co-authored-by: darkhan.nausharipov <darkhan.naushari...@kzn.akvelon.com>
---
 .../frontend/lib/components/scaffold.dart           | 21 ++++++++++++++++++++-
 .../frontend/lib/pages/welcome/screen.dart          | 12 ++++++------
 2 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/learning/tour-of-beam/frontend/lib/components/scaffold.dart 
b/learning/tour-of-beam/frontend/lib/components/scaffold.dart
index bb67351fbff..4b280418c57 100644
--- a/learning/tour-of-beam/frontend/lib/components/scaffold.dart
+++ b/learning/tour-of-beam/frontend/lib/components/scaffold.dart
@@ -16,12 +16,14 @@
  * limitations under the License.
  */
 
+import 'package:app_state/app_state.dart';
 import 'package:firebase_auth/firebase_auth.dart';
 import 'package:flutter/material.dart';
 import 'package:get_it/get_it.dart';
 import 'package:playground_components/playground_components.dart';
 
 import '../pages/tour/widgets/pipeline_options.dart';
+import '../pages/welcome/page.dart';
 import '../state.dart';
 import 'footer.dart';
 import 'login/button.dart';
@@ -43,7 +45,7 @@ class TobScaffold extends StatelessWidget {
     return Scaffold(
       appBar: AppBar(
         automaticallyImplyLeading: false,
-        title: const Logo(),
+        title: const _HomepageLinkLogo(),
         actions: [
           if (playgroundController != null)
             _PlaygroundControllerActions(
@@ -70,6 +72,23 @@ class TobScaffold extends StatelessWidget {
   }
 }
 
+class _HomepageLinkLogo extends StatelessWidget {
+  const _HomepageLinkLogo();
+
+  @override
+  Widget build(BuildContext context) {
+    return MouseRegion(
+      cursor: SystemMouseCursors.click,
+      child: GestureDetector(
+        onTap: () {
+          GetIt.instance.get<PageStack>().popUntilBottom();
+        },
+        child: const Logo(),
+      ),
+    );
+  }
+}
+
 class _Profile extends StatelessWidget {
   const _Profile();
 
diff --git a/learning/tour-of-beam/frontend/lib/pages/welcome/screen.dart 
b/learning/tour-of-beam/frontend/lib/pages/welcome/screen.dart
index 2d44a579570..32351a6b43a 100644
--- a/learning/tour-of-beam/frontend/lib/pages/welcome/screen.dart
+++ b/learning/tour-of-beam/frontend/lib/pages/welcome/screen.dart
@@ -367,7 +367,7 @@ class _Module extends StatelessWidget {
   Widget build(BuildContext context) {
     return Column(
       children: [
-        _ModuleHeader(title: module.title),
+        _ModuleHeader(module: module),
         if (isLast) const _LastModuleBody() else const _ModuleBody(),
       ],
     );
@@ -375,9 +375,9 @@ class _Module extends StatelessWidget {
 }
 
 class _ModuleHeader extends StatelessWidget {
-  final String title;
+  final ModuleModel module;
 
-  const _ModuleHeader({required this.title});
+  const _ModuleHeader({required this.module});
 
   @override
   Widget build(BuildContext context) {
@@ -400,7 +400,7 @@ class _ModuleHeader extends StatelessWidget {
               const SizedBox(width: BeamSizes.size16),
               Expanded(
                 child: Text(
-                  title,
+                  module.title,
                   style: Theme.of(context).textTheme.titleLarge,
                 ),
               ),
@@ -410,11 +410,11 @@ class _ModuleHeader extends StatelessWidget {
         Row(
           children: [
             Text(
-              'complexity.medium',
+              'complexity.${module.complexity.name}',
               style: Theme.of(context).textTheme.headlineSmall,
             ).tr(),
             const SizedBox(width: BeamSizes.size6),
-            const ComplexityWidget(complexity: Complexity.medium),
+            ComplexityWidget(complexity: module.complexity),
           ],
         ),
       ],

Reply via email to