Skip to content

Commit

Permalink
TW-1025: recolor active status and chat list typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE authored and hoangdat committed Nov 24, 2023
1 parent 3c1ec25 commit bdc34d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/pages/chat/chat_app_bar_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ class _ChatAppBarTitleText extends StatelessWidget {

@override
Widget build(BuildContext context) {
final TextStyle? statusTextStyle =
ChatAppBarTitleStyle.statusTextStyle(context);
final TextStyle? statusTextStyle = text == L10n.of(context)!.activeNow
? ChatAppBarTitleStyle.onlineStatusTextStyle(context)
: ChatAppBarTitleStyle.offlineStatusTextStyle(context);

return Text(
text,
Expand All @@ -262,7 +263,7 @@ class _ChatAppBarTitleTyping extends StatelessWidget {
@override
Widget build(BuildContext context) {
final TextStyle? statusTextStyle =
ChatAppBarTitleStyle.statusTextStyle(context);
ChatAppBarTitleStyle.onlineStatusTextStyle(context);

return IntrinsicWidth(
child: Row(
Expand Down
13 changes: 12 additions & 1 deletion lib/pages/chat/chat_app_bar_title_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ChatAppBarTitleStyle {
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);

static TextStyle? statusTextStyle(BuildContext context) =>
static TextStyle? offlineStatusTextStyle(BuildContext context) =>
responsive.isMobile(context)
? Theme.of(context).textTheme.labelMedium?.copyWith(
color: LinagoraRefColors.material().tertiary[30],
Expand All @@ -40,4 +40,15 @@ class ChatAppBarTitleStyle {
color: LinagoraRefColors.material().neutral[50],
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);

static TextStyle? onlineStatusTextStyle(BuildContext context) =>
responsive.isMobile(context)
? Theme.of(context).textTheme.labelMedium?.copyWith(
color: LinagoraRefColors.material().secondary,
letterSpacing: ChatAppBarTitleStyle.letterSpacingStatusContent,
)
: Theme.of(context).textTheme.bodySmall?.copyWith(
color: LinagoraRefColors.material().secondary,
letterSpacing: ChatAppBarTitleStyle.letterSpacingRoomName,
);
}
3 changes: 2 additions & 1 deletion lib/presentation/mixins/chat_list_item_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:fluffychat/presentation/decorators/chat_list/subtitle_text_style
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:linagora_design_flutter/colors/linagora_ref_colors.dart';
import 'package:matrix/matrix.dart';

mixin ChatListItemMixin {
Expand Down Expand Up @@ -49,7 +50,7 @@ mixin ChatListItemMixin {
style: Theme.of(context).textTheme.labelLarge?.merge(
TextStyle(
overflow: TextOverflow.ellipsis,
color: Theme.of(context).colorScheme.primary,
color: LinagoraRefColors.material().secondary,
),
),
maxLines: 2,
Expand Down

0 comments on commit bdc34d0

Please sign in to comment.