refactor: Improved UX for room upgrades
This commit is contained in:
parent
730fb22be3
commit
b645193f7b
5 changed files with 37 additions and 47 deletions
|
|
@ -169,11 +169,6 @@ class ChatView extends StatelessWidget {
|
|||
if (scrollUpBannerEventId != null) {
|
||||
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
|
||||
}
|
||||
final tombstoneEvent =
|
||||
controller.room.getState(EventTypes.RoomTombstone);
|
||||
if (tombstoneEvent != null) {
|
||||
appbarBottomHeight += ChatAppBarListTile.fixedHeight;
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
actionsIconTheme: IconThemeData(
|
||||
|
|
@ -212,18 +207,6 @@ class ChatView extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
PinnedEvents(controller),
|
||||
if (tombstoneEvent != null)
|
||||
ChatAppBarListTile(
|
||||
title: tombstoneEvent.parsedTombstoneContent.body,
|
||||
leading: const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.upgrade_outlined),
|
||||
),
|
||||
trailing: TextButton(
|
||||
onPressed: controller.goToNewRoomAction,
|
||||
child: Text(L10n.of(context).goToTheNewRoom),
|
||||
),
|
||||
),
|
||||
if (scrollUpBannerEventId != null)
|
||||
ChatAppBarListTile(
|
||||
leading: IconButton(
|
||||
|
|
@ -300,7 +283,21 @@ class ChatView extends StatelessWidget {
|
|||
child: ChatEventList(controller: controller),
|
||||
),
|
||||
),
|
||||
if (controller.room.canSendDefaultMessages &&
|
||||
if (controller.room.isExtinct)
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
bottom: bottomSheetPadding,
|
||||
left: bottomSheetPadding,
|
||||
right: bottomSheetPadding,
|
||||
),
|
||||
width: double.infinity,
|
||||
child: ElevatedButton.icon(
|
||||
icon: const Icon(Icons.chevron_right),
|
||||
label: Text(L10n.of(context).enterNewChat),
|
||||
onPressed: controller.goToNewRoomAction,
|
||||
),
|
||||
)
|
||||
else if (controller.room.canSendDefaultMessages &&
|
||||
controller.room.membership == Membership.join)
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue