WIP: Support for pinned messages #49
2 changed files with 7 additions and 4 deletions
rename PinnedMessages to PinnedEventsDrawer
commit
5c78cc85f7
|
|
@ -6,10 +6,10 @@ import "package:nexus/models/event.dart";
|
||||||
import "package:nexus/widgets/loading.dart";
|
import "package:nexus/widgets/loading.dart";
|
||||||
import "package:nexus/widgets/renderers/event.dart";
|
import "package:nexus/widgets/renderers/event.dart";
|
||||||
|
|
||||||
class PinnedMessages extends HookConsumerWidget {
|
class PinnedEventsDrawer extends HookConsumerWidget {
|
||||||
final String roomId;
|
final String roomId;
|
||||||
final IList<PopupMenuEntry> Function(Event event)? getEventOptions;
|
final IList<PopupMenuEntry> Function(Event event)? getEventOptions;
|
||||||
const PinnedMessages(this.roomId, {this.getEventOptions, super.key});
|
const PinnedEventsDrawer(this.roomId, {this.getEventOptions, super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
|
@ -17,7 +17,7 @@ import "package:nexus/models/event.dart";
|
||||||
import "package:nexus/models/relation_type.dart";
|
import "package:nexus/models/relation_type.dart";
|
||||||
import "package:nexus/widgets/composer/composer.dart";
|
import "package:nexus/widgets/composer/composer.dart";
|
||||||
import "package:nexus/widgets/emoji_picker_button.dart";
|
import "package:nexus/widgets/emoji_picker_button.dart";
|
||||||
import "package:nexus/widgets/pinned_messages.dart";
|
import "package:nexus/widgets/pinned_events_drawer.dart";
|
||||||
import "package:nexus/widgets/renderers/event.dart";
|
import "package:nexus/widgets/renderers/event.dart";
|
||||||
import "package:nexus/widgets/member_list.dart";
|
import "package:nexus/widgets/member_list.dart";
|
||||||
import "package:nexus/widgets/room_appbar.dart";
|
import "package:nexus/widgets/room_appbar.dart";
|
||||||
|
|
@ -524,7 +524,10 @@ class RoomChat extends HookConsumerWidget {
|
||||||
shape: Border(),
|
shape: Border(),
|
||||||
child: memberListOpened.value
|
child: memberListOpened.value
|
||||||
? MemberList(roomId)
|
? MemberList(roomId)
|
||||||
: PinnedMessages(roomId, getEventOptions: getEventOptions),
|
: PinnedEventsDrawer(
|
||||||
|
roomId,
|
||||||
|
getEventOptions: getEventOptions,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue