diff --git a/frontend/appflowy_flutter/ios/Podfile.lock b/frontend/appflowy_flutter/ios/Podfile.lock index af96ce7ccb..8829c71074 100644 --- a/frontend/appflowy_flutter/ios/Podfile.lock +++ b/frontend/appflowy_flutter/ios/Podfile.lock @@ -174,7 +174,7 @@ SPEC CHECKSUMS: file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 flowy_infra_ui: 0455e1fa8c51885aa1437848e361e99419f34ebc Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - fluttertoast: 723e187574b149e68e63ca4d39b837586b903cfa + fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425 integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4 irondash_engine_context: 3458bf979b90d616ffb8ae03a150bafe2e860cc9 @@ -196,4 +196,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: d0d9b4ff572d8695c38eb3f9b490f55cdfc57eca -COCOAPODS: 1.11.3 +COCOAPODS: 1.15.2 diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_folders.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_folders.dart index dc9602ca13..c7a4acd07f 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_folders.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_folders.dart @@ -1,20 +1,16 @@ -import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/mobile/presentation/home/section_folder/mobile_home_section_folder.dart'; import 'package:appflowy/mobile/presentation/home/space/mobile_space.dart'; -import 'package:appflowy/mobile/presentation/presentation.dart'; import 'package:appflowy/workspace/application/menu/sidebar_sections_bloc.dart'; import 'package:appflowy/workspace/application/sidebar/folder/folder_bloc.dart'; import 'package:appflowy/workspace/application/sidebar/space/space_bloc.dart'; import 'package:appflowy/workspace/application/user/user_workspace_bloc.dart'; -import 'package:appflowy/workspace/presentation/home/home_sizes.dart'; import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; -import 'package:go_router/go_router.dart'; // Contains Public And Private Sections class MobileFolders extends StatelessWidget { @@ -73,13 +69,7 @@ class _MobileFolderState extends State<_MobileFolder> { child: Column( children: [ ..._buildSpaceOrSection(context, state), - const VSpace(4.0), - const Padding( - padding: EdgeInsets.symmetric( - horizontal: HomeSpaceViewSizes.mHorizontalPadding, - ), - child: _TrashButton(), - ), + const VSpace(80.0), ], ), ); @@ -122,28 +112,3 @@ class _MobileFolderState extends State<_MobileFolder> { ]; } } - -class _TrashButton extends StatelessWidget { - const _TrashButton(); - - @override - Widget build(BuildContext context) { - return SizedBox( - height: 52, - child: FlowyButton( - expand: true, - margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 2.0), - leftIcon: const FlowySvg( - FlowySvgs.m_delete_s, - ), - leftIconSize: const Size.square(18), - iconPadding: 10.0, - text: FlowyText.regular( - LocaleKeys.trash_text.tr(), - fontSize: 16.0, - ), - onTap: () => context.push(MobileHomeTrashPage.routeName), - ), - ); - } -} diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page.dart index d3a0a5ed23..c3f0340953 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page.dart @@ -249,6 +249,8 @@ class _HomePageState extends State<_HomePage> { return; } + Log.info('workspace action result: $actionResult'); + final actionType = actionResult.actionType; final result = actionResult.result; final isLoading = actionResult.isLoading; diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart index ccd663a5b3..24c0b5432f 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/mobile_home_page_header.dart @@ -2,7 +2,6 @@ import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/mobile/presentation/base/gesture.dart'; import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart'; -import 'package:appflowy/mobile/presentation/home/mobile_home_setting_page.dart'; import 'package:appflowy/mobile/presentation/home/workspaces/workspace_menu_bottom_sheet.dart'; import 'package:appflowy/plugins/base/emoji/emoji_picker_screen.dart'; import 'package:appflowy/shared/icon_emoji_picker/flowy_icon_emoji_picker.dart'; @@ -18,6 +17,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'setting/settings_popup_menu.dart'; + class MobileHomePageHeader extends StatelessWidget { const MobileHomePageHeader({ super.key, @@ -45,15 +46,16 @@ class MobileHomePageHeader extends StatelessWidget { ? _MobileWorkspace(userProfile: userProfile) : _MobileUser(userProfile: userProfile), ), - GestureDetector( - onTap: () => context.push( - MobileHomeSettingPage.routeName, - ), - child: const Padding( - padding: EdgeInsets.all(8.0), - child: FlowySvg(FlowySvgs.m_notification_settings_s), - ), - ), + const HomePageSettingsPopupMenu(), + // GestureDetector( + // onTap: () => context.push( + // MobileHomeSettingPage.routeName, + // ), + // child: const Padding( + // padding: EdgeInsets.all(8.0), + // child: FlowySvg(FlowySvgs.m_notification_settings_s), + // ), + // ), const HSpace(8.0), ], ), diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/home/setting/settings_popup_menu.dart b/frontend/appflowy_flutter/lib/mobile/presentation/home/setting/settings_popup_menu.dart new file mode 100644 index 0000000000..ae7842d08f --- /dev/null +++ b/frontend/appflowy_flutter/lib/mobile/presentation/home/setting/settings_popup_menu.dart @@ -0,0 +1,143 @@ +import 'package:appflowy/core/helpers/url_launcher.dart'; +import 'package:appflowy/generated/flowy_svgs.g.dart'; +import 'package:appflowy/generated/locale_keys.g.dart'; +import 'package:appflowy/mobile/presentation/presentation.dart'; +import 'package:appflowy/mobile/presentation/setting/workspace/invite_members_screen.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flowy_infra_ui/flowy_infra_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +enum _MobileSettingsPopupMenuItem { + settings, + members, + trash, + help, +} + +class HomePageSettingsPopupMenu extends StatelessWidget { + const HomePageSettingsPopupMenu({super.key}); + + @override + Widget build(BuildContext context) { + return PopupMenuButton<_MobileSettingsPopupMenuItem>( + offset: const Offset(0, 36), + padding: EdgeInsets.zero, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all( + Radius.circular(12.0), + ), + ), + // todo: replace it with shadows + shadowColor: const Color(0x68000000), + elevation: 10, + child: const Padding( + padding: EdgeInsets.all(8.0), + child: FlowySvg( + FlowySvgs.m_settings_more_s, + ), + ), + itemBuilder: (BuildContext context) => + >[ + _buildItem( + value: _MobileSettingsPopupMenuItem.settings, + svg: FlowySvgs.m_notification_settings_s, + text: LocaleKeys.settings_popupMenuItem_settings.tr(), + ), + const PopupMenuDivider(height: 0.5), + _buildItem( + value: _MobileSettingsPopupMenuItem.members, + svg: FlowySvgs.m_settings_member_s, + text: LocaleKeys.settings_popupMenuItem_members.tr(), + ), + const PopupMenuDivider(height: 0.5), + _buildItem( + value: _MobileSettingsPopupMenuItem.trash, + svg: FlowySvgs.trash_s, + text: LocaleKeys.settings_popupMenuItem_trash.tr(), + ), + const PopupMenuDivider(height: 0.5), + _buildItem( + value: _MobileSettingsPopupMenuItem.help, + svg: FlowySvgs.message_support_s, + text: LocaleKeys.settings_popupMenuItem_helpAndSupport.tr(), + ), + ], + onSelected: (_MobileSettingsPopupMenuItem value) { + switch (value) { + case _MobileSettingsPopupMenuItem.members: + _openMembersPage(context); + break; + case _MobileSettingsPopupMenuItem.trash: + _openTrashPage(context); + break; + case _MobileSettingsPopupMenuItem.settings: + _openSettingsPage(context); + break; + case _MobileSettingsPopupMenuItem.help: + _openHelpPage(context); + break; + } + }, + ); + } + + PopupMenuItem _buildItem({ + required T value, + required FlowySvgData svg, + required String text, + }) { + return PopupMenuItem( + value: value, + padding: EdgeInsets.zero, + child: _PopupButton( + svg: svg, + text: text, + ), + ); + } + + void _openMembersPage(BuildContext context) { + context.push(InviteMembersScreen.routeName); + } + + void _openTrashPage(BuildContext context) { + context.push(MobileHomeTrashPage.routeName); + } + + void _openHelpPage(BuildContext context) { + afLaunchUrlString('https://discord.com/invite/9Q2xaN37tV'); + } + + void _openSettingsPage(BuildContext context) { + context.push(MobileHomeSettingPage.routeName); + } +} + +class _PopupButton extends StatelessWidget { + const _PopupButton({ + required this.svg, + required this.text, + }); + + final FlowySvgData svg; + final String text; + + @override + Widget build(BuildContext context) { + return Container( + height: 44, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), + child: Row( + children: [ + FlowySvg(svg, size: const Size.square(20)), + const HSpace(12), + FlowyText.regular( + text, + fontSize: 16, + ), + ], + ), + ); + } +} diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/header.dart b/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/header.dart index c42fc48cd3..9f1311d1e7 100644 --- a/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/header.dart +++ b/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/header.dart @@ -18,7 +18,7 @@ class MobileNotificationPageHeader extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - const HSpace(16.0), + const HSpace(18.0), FlowyText( LocaleKeys.settings_notifications_titles_notifications.tr(), fontSize: 20, diff --git a/frontend/appflowy_flutter/lib/workspace/application/user/user_workspace_bloc.dart b/frontend/appflowy_flutter/lib/workspace/application/user/user_workspace_bloc.dart index e10e9cc6c8..16fed97f7c 100644 --- a/frontend/appflowy_flutter/lib/workspace/application/user/user_workspace_bloc.dart +++ b/frontend/appflowy_flutter/lib/workspace/application/user/user_workspace_bloc.dart @@ -493,6 +493,11 @@ class UserWorkspaceActionResult { final UserWorkspaceActionType actionType; final bool isLoading; final FlowyResult? result; + + @override + String toString() { + return 'UserWorkspaceActionResult(actionType: $actionType, isLoading: $isLoading, result: $result)'; + } } @freezed diff --git a/frontend/resources/flowy_icons/16x/m_settings_member.svg b/frontend/resources/flowy_icons/16x/m_settings_member.svg new file mode 100644 index 0000000000..edd1e3fe83 --- /dev/null +++ b/frontend/resources/flowy_icons/16x/m_settings_member.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json index 05d15177a7..dfd9602ed5 100644 --- a/frontend/resources/translations/en.json +++ b/frontend/resources/translations/en.json @@ -395,6 +395,12 @@ }, "settings": { "title": "Settings", + "popupMenuItem": { + "settings": "Settings", + "members": "Members", + "trash": "Trash", + "helpAndSupport": "Help & Support" + }, "accountPage": { "menuLabel": "My account", "title": "My account",