chore: add tooltip when import notion file (#6557)

This commit is contained in:
Nathan.fooo 2024-10-16 13:55:21 +08:00 committed by GitHub
parent c6f042830f
commit e86d812ee6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 42 additions and 17 deletions

View File

@ -1,3 +1,4 @@
import 'package:appflowy/core/helpers/url_launcher.dart';
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/startup/startup.dart'; import 'package:appflowy/startup/startup.dart';
@ -15,6 +16,7 @@ import 'package:flowy_infra/file_picker/file_picker_service.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:universal_platform/universal_platform.dart';
import '_sidebar_import_notion.dart'; import '_sidebar_import_notion.dart';
@ -88,8 +90,11 @@ class WorkspacesMenu extends StatelessWidget {
// add new workspace // add new workspace
const _CreateWorkspaceButton(), const _CreateWorkspaceButton(),
const VSpace(6.0), const VSpace(6.0),
const _ImportNotionButton(),
const VSpace(6.0), if (UniversalPlatform.isDesktop) ...[
const _ImportNotionButton(),
const VSpace(6.0),
],
], ],
); );
} }
@ -375,21 +380,40 @@ class _ImportNotionButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return SizedBox(
height: 40, height: 40,
child: FlowyButton( child: Stack(
key: importNotionButtonKey, alignment: Alignment.centerRight,
onTap: () { children: [
_showImportNotinoDialog(context); FlowyButton(
}, key: importNotionButtonKey,
margin: const EdgeInsets.symmetric(horizontal: 4.0), onTap: () {
text: Row( _showImportNotinoDialog(context);
children: [ },
_buildLeftIcon(context), margin: const EdgeInsets.symmetric(horizontal: 4.0),
const HSpace(8.0), text: Row(
FlowyText.regular( children: [
LocaleKeys.workspace_importFromNotion.tr(), _buildLeftIcon(context),
const HSpace(8.0),
FlowyText.regular(
LocaleKeys.workspace_importFromNotion.tr(),
),
],
), ),
], ),
), FlowyTooltip(
message: LocaleKeys.workspace_learnMore.tr(),
preferBelow: true,
child: FlowyIconButton(
icon: const FlowySvg(
FlowySvgs.information_s,
),
onPressed: () {
afLaunchUrlString(
'https://docs.appflowy.io/docs/guides/import-from-notion',
);
},
),
),
],
), ),
); );
} }

View File

@ -75,6 +75,7 @@
"defaultName": "My Workspace", "defaultName": "My Workspace",
"create": "Create workspace", "create": "Create workspace",
"importFromNotion": "Import From Notion", "importFromNotion": "Import From Notion",
"learnMore": "Learn more",
"reset": "Reset workspace", "reset": "Reset workspace",
"renameWorkspace": "Rename workspace", "renameWorkspace": "Rename workspace",
"workspaceNameCannotBeEmpty": "Workspace name cannot be empty", "workspaceNameCannotBeEmpty": "Workspace name cannot be empty",