Skip to content

Commit

Permalink
feat: support copy share link
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Oct 15, 2024
1 parent f74dff8 commit b8ac4cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/bottom_sheet/bottom_sheet.dart';
import 'package:appflowy/plugins/document/presentation/editor_notification.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart';
import 'package:appflowy/plugins/shared/share/constants.dart';
import 'package:appflowy/plugins/shared/share/publish_name_generator.dart';
import 'package:appflowy/plugins/shared/share/share_bloc.dart';
import 'package:appflowy/startup/startup.dart';
Expand Down Expand Up @@ -147,7 +148,12 @@ class MobileViewPageMoreBottomSheet extends StatelessWidget {
}

void _copyShareLink(BuildContext context) {
final url = context.read<ShareBloc>().state.url;
final workspaceId = context.read<ShareBloc>().state.workspaceId;
final viewId = context.read<ShareBloc>().state.viewId;
final url = ShareConstants.buildShareUrl(
workspaceId: workspaceId,
viewId: viewId,
);
if (url.isNotEmpty) {
unawaited(
getIt<ClipboardService>().setData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class MobileViewBottomSheetBody extends StatelessWidget {
// copy link
_divider(),
MobileQuickActionButton(
text: 'Copy share link',
text: LocaleKeys.shareAction_copyShareLink.tr(),
icon: FlowySvgs.m_toolbar_link_m,
onTap: () => onAction(
MobileViewBottomSheetBodyAction.copyShareLink,
Expand Down

0 comments on commit b8ac4cc

Please sign in to comment.