fix conditional rendering of popover actions
This commit is contained in:
parent
786c8cb3e2
commit
2ec442b35b
6 changed files with 7 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ extension ShowUserPopover on BuildContext {
|
|||
void showUserPopover(
|
||||
MembershipContent member,
|
||||
String userId, {
|
||||
String? roomId,
|
||||
required Offset globalPosition,
|
||||
}) => showContextMenu(
|
||||
globalPosition: globalPosition,
|
||||
|
|
@ -16,7 +17,7 @@ extension ShowUserPopover on BuildContext {
|
|||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: IconTheme(
|
||||
data: IconThemeData(),
|
||||
child: UserPopover(member, userId),
|
||||
child: UserPopover(member, userId, roomId: roomId),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class MentionChip extends ConsumerWidget {
|
|||
context.showUserPopover(
|
||||
membership,
|
||||
mention,
|
||||
roomId: roomId,
|
||||
globalPosition: details.globalPosition,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class MessageAvatar extends ConsumerWidget {
|
|||
onTapUp: (details) => context.showUserPopover(
|
||||
value,
|
||||
event.sender,
|
||||
roomId: event.roomId,
|
||||
globalPosition: details.globalPosition,
|
||||
),
|
||||
child: AvatarOrHash(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class MessageDisplayname extends ConsumerWidget {
|
|||
? (details) => context.showUserPopover(
|
||||
value,
|
||||
event.sender,
|
||||
roomId: event.roomId,
|
||||
globalPosition: details.globalPosition,
|
||||
)
|
||||
: null,
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ class MemberList extends HookConsumerWidget {
|
|||
onTapUp: (details) => context.showUserPopover(
|
||||
member.content as MembershipContent,
|
||||
member.stateKey!,
|
||||
roomId: roomId,
|
||||
globalPosition: details.globalPosition,
|
||||
),
|
||||
child: ListTile(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class MembershipRenderer extends StatelessWidget {
|
|||
onTapUp: (details) => context.showUserPopover(
|
||||
content,
|
||||
event.stateKey!,
|
||||
roomId: event.roomId,
|
||||
globalPosition: details.globalPosition,
|
||||
),
|
||||
child: Text(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue