feat github redirect (#2867)

* feat: add GitHub to question bubble

* feat: translate to feedback
This commit is contained in:
Alex Wallen 2023-06-26 15:53:38 -10:00 committed by GitHub
parent 88faa0f02a
commit 386d3f2ba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 9 deletions

View File

@ -90,7 +90,8 @@
"name": "Debug Info", "name": "Debug Info",
"success": "Copied debug info to clipboard!", "success": "Copied debug info to clipboard!",
"fail": "Unable to copy debug info to clipboard" "fail": "Unable to copy debug info to clipboard"
} },
"feedback": "Feedback"
}, },
"menuAppHeader": { "menuAppHeader": {
"addPageTooltip": "Quickly add a page inside", "addPageTooltip": "Quickly add a page inside",

View File

@ -3,6 +3,7 @@ import 'package:appflowy/workspace/presentation/home/toast.dart';
import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart'; import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flowy_infra_ui/style_widget/button.dart'; import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart'; import 'package:flowy_infra_ui/style_widget/text.dart';
@ -78,6 +79,11 @@ class BubbleActionList extends StatelessWidget {
"https://appflowy.gitbook.io/docs/essential-documentation/markdown", "https://appflowy.gitbook.io/docs/essential-documentation/markdown",
); );
break; break;
case BubbleAction.github:
_launchURL(
'https://github.com/AppFlowy-IO/AppFlowy/issues/new/choose',
);
break;
} }
} }
@ -169,14 +175,14 @@ class FlowyVersionDescription extends CustomActionCell {
} }
} }
enum BubbleAction { whatsNews, help, debug, shortcuts, markdown } enum BubbleAction { whatsNews, help, debug, shortcuts, markdown, github }
class BubbleActionWrapper extends ActionCell { class BubbleActionWrapper extends ActionCell {
final BubbleAction inner; final BubbleAction inner;
BubbleActionWrapper(this.inner); BubbleActionWrapper(this.inner);
@override @override
Widget? leftIcon(Color iconColor) => FlowyText.regular(inner.emoji); Widget? leftIcon(Color iconColor) => inner.emoji;
@override @override
String get name => inner.name; String get name => inner.name;
@ -195,21 +201,31 @@ extension QuestionBubbleExtension on BubbleAction {
return LocaleKeys.questionBubble_shortcuts.tr(); return LocaleKeys.questionBubble_shortcuts.tr();
case BubbleAction.markdown: case BubbleAction.markdown:
return LocaleKeys.questionBubble_markdown.tr(); return LocaleKeys.questionBubble_markdown.tr();
case BubbleAction.github:
return LocaleKeys.questionBubble_feedback.tr();
} }
} }
String get emoji { Widget get emoji {
switch (this) { switch (this) {
case BubbleAction.whatsNews: case BubbleAction.whatsNews:
return '🆕'; return const FlowyText.regular('🆕');
case BubbleAction.help: case BubbleAction.help:
return '👥'; return const FlowyText.regular('👥');
case BubbleAction.debug: case BubbleAction.debug:
return '🐛'; return const FlowyText.regular('🐛');
case BubbleAction.shortcuts: case BubbleAction.shortcuts:
return '📋'; return const FlowyText.regular('📋');
case BubbleAction.markdown: case BubbleAction.markdown:
return ''; return const FlowyText.regular('');
case BubbleAction.github:
return Padding(
padding: const EdgeInsets.all(3.0),
child: svgWidget(
'login/github-mark',
size: const Size.square(12),
),
);
} }
} }
} }