Skip to content

Commit

Permalink
fixup! TW-902: new design group informations
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE committed Dec 8, 2023
1 parent 0146b03 commit 5144aa7
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 38 deletions.
2 changes: 1 addition & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -2956,7 +2956,7 @@
"failToSend": "Failed to send, please try again",
"showLess": "Show Less",
"showMore": "Show More",
"groupInformations": "Group informations",
"groupInformations": "Group information",
"linkInvite": "Link invite",
"noDescription": "No description",
"description": "Description",
Expand Down
6 changes: 3 additions & 3 deletions lib/domain/app_state/room/update_group_chat_success.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ class UpdateGroupChatInitial extends Success {
}

class UpdateGroupChatSuccess extends Success {
final MatrixFile? roomAvatar;
final MatrixFile? roomAvatarFile;
final String? displayName;
final String? description;
final bool isDeleteAvatar;

const UpdateGroupChatSuccess({
this.roomAvatar,
this.roomAvatarFile,
this.displayName,
this.description,
this.isDeleteAvatar = false,
});

@override
List<Object?> get props =>
[roomAvatar, displayName, description, isDeleteAvatar];
[roomAvatarFile, displayName, description, isDeleteAvatar];
}
2 changes: 1 addition & 1 deletion lib/domain/usecase/room/update_group_chat_interactor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class UpdateGroupChatInteractor {
yield Right(
UpdateGroupChatSuccess(
displayName: displayName,
roomAvatar: avatar,
roomAvatarFile: avatar,
description: description,
isDeleteAvatar: isDeleteAvatar,
),
Expand Down
22 changes: 4 additions & 18 deletions lib/pages/chat_details/chat_details_edit_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,9 @@ class _GroupNameField extends StatelessWidget {
borderSide: BorderSide(color: Theme.of(context).colorScheme.shadow),
),
labelText: L10n.of(context)!.widgetName,
labelStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 16,
letterSpacing: 0.4,
color: Theme.of(context).colorScheme.onSurface,
),
labelStyle: ChatDetailEditViewStyle.textFieldLabelStyle(context),
hintText: L10n.of(context)!.enterGroupName,
hintStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
letterSpacing: -0.15,
color: Theme.of(context).colorScheme.onSurface,
),
hintStyle: ChatDetailEditViewStyle.textFieldHintStyle(context),
contentPadding: ChatDetailEditViewStyle.contentPadding,
),
),
Expand Down Expand Up @@ -341,16 +334,9 @@ class _DescriptionField extends StatelessWidget {
BorderSide(color: Theme.of(context).colorScheme.shadow),
),
labelText: L10n.of(context)!.description,
labelStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 16,
letterSpacing: 0.4,
color: Theme.of(context).colorScheme.onSurface,
),
labelStyle: ChatDetailEditViewStyle.textFieldLabelStyle(context),
hintText: L10n.of(context)!.description,
hintStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
letterSpacing: -0.15,
color: Theme.of(context).colorScheme.onSurface,
),
hintStyle: ChatDetailEditViewStyle.textFieldHintStyle(context),
contentPadding: ChatDetailEditViewStyle.contentPadding,
),
),
Expand Down
11 changes: 11 additions & 0 deletions lib/pages/chat_details/chat_details_edit_view_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ class ChatDetailEditViewStyle {
static const double textFieldsGap = 16.0;
static const EdgeInsets textFieldPadding =
EdgeInsets.symmetric(horizontal: 8.0);
static TextStyle? textFieldLabelStyle(BuildContext context) =>
Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 16,
letterSpacing: 0.4,
color: Theme.of(context).colorScheme.onSurface,
);
static TextStyle? textFieldHintStyle(BuildContext context) =>
Theme.of(context).textTheme.bodyLarge?.copyWith(
letterSpacing: -0.15,
color: Theme.of(context).colorScheme.onSurface,
);

static const EdgeInsetsDirectional contentPadding =
EdgeInsetsDirectional.all(16.0);
Expand Down
26 changes: 11 additions & 15 deletions lib/pages/chat_details/chat_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ class ChatDetailsView extends StatelessWidget {
title: L10n.of(context)!.groupDescription,
),
subtitle: _TileSubtitleText(
subtitle:
controller.room?.topic == null ||
controller.room!.topic.isEmpty
? L10n.of(context)!.noDescription
: controller.room!.topic,
subtitle: controller.room?.topic == null ||
controller.room!.topic.isEmpty
? L10n.of(context)!.noDescription
: controller.room!.topic,
),
),
ValueListenableBuilder(
Expand All @@ -125,8 +124,7 @@ class ChatDetailsView extends StatelessWidget {
Icons.notifications_outlined,
),
title: _TileTitleText(
title:
L10n.of(context)!.notifications,
title: L10n.of(context)!.notifications,
),
trailing: SizedBox(
width: ChatDetailViewStyle
Expand All @@ -136,15 +134,13 @@ class ChatDetailsView extends StatelessWidget {
child: FittedBox(
fit: BoxFit.fill,
child: Switch(
activeTrackColor:
Theme.of(context)
.colorScheme
.primary,
activeTrackColor: Theme.of(context)
.colorScheme
.primary,
value: pushRuleState ==
PushRuleState.notify,
onChanged: (value) {
controller
.onToggleNotification();
controller.onToggleNotification();
},
),
),
Expand Down Expand Up @@ -350,7 +346,7 @@ class _GroupInformation extends StatelessWidget {
),
),
width: constraints.maxWidth,
height: ChatDetailViewStyle.avatarHeight(context),
height: ChatDetailViewStyle.avatarHeight,
child: Center(
child: Text(
text,
Expand All @@ -369,7 +365,7 @@ class _GroupInformation extends StatelessWidget {
return MxcImage(
uri: avatarUri,
width: constraints.maxWidth,
height: ChatDetailViewStyle.avatarHeight(context),
height: ChatDetailViewStyle.avatarHeight,
fit: BoxFit.cover,
placeholder: (_) => placeholder,
cacheKey: avatarUri.toString(),
Expand Down

0 comments on commit 5144aa7

Please sign in to comment.