Lucas 97913c390b
feat: support share page and block (#6431)
* feat: support share page

* feat: support copy share link

* chore: replace share icon

* chore: update translations

* chore: optimize code

* test: add share link test

* feat: support copy block link

* test: add copy link to block test

* chore: refactor share code

* fix: doc bloc not found issue
2024-10-03 14:31:04 +08:00

24 lines
603 B
Dart

class ShareConstants {
static const String publishBaseUrl = 'https://appflowy.com';
static const String shareBaseUrl = 'https://appflowy.com/app';
static String buildPublishUrl({
required String nameSpace,
required String publishName,
}) {
return '$publishBaseUrl/$nameSpace/$publishName';
}
static String buildShareUrl({
required String workspaceId,
required String viewId,
String? blockId,
}) {
final url = '$shareBaseUrl/$workspaceId/$viewId';
if (blockId == null || blockId.isEmpty) {
return url;
}
return '$url?blockId=$blockId';
}
}