feat: add a hub for the client's own pages and gate mews:do action links
This commit is contained in:
parent
df705d831f
commit
b311b9f7dd
21 changed files with 966 additions and 404 deletions
32
app/lib/application/pages/bookmarks_page.dart
Normal file
32
app/lib/application/pages/bookmarks_page.dart
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import '../../database/database.dart';
|
||||
import '../../l10n/strings.dart';
|
||||
import '../../mews/document.dart';
|
||||
import 'page_blocks.dart';
|
||||
|
||||
Future<MewsPage> buildBookmarksPage(
|
||||
Uri url, {
|
||||
required MewsDatabase db,
|
||||
required Strings strings,
|
||||
}) async {
|
||||
final bookmarks = await db.bookmarksByDate();
|
||||
final title = strings.t('bookmarks-title');
|
||||
|
||||
return internalPage(
|
||||
url: url,
|
||||
title: title,
|
||||
body: [
|
||||
...chrome(title: title, current: url, strings: strings),
|
||||
if (bookmarks.isEmpty)
|
||||
ParagraphBlock([MewsText(strings.t('bookmarks-empty'))])
|
||||
else
|
||||
itemList([
|
||||
for (final bookmark in bookmarks)
|
||||
itemRow(
|
||||
href: bookmark.url,
|
||||
label: bookmark.title ?? bookmark.url,
|
||||
date: dayText(bookmark.createdAt),
|
||||
),
|
||||
]),
|
||||
],
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue