Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Make comments screen more similar to figma design

ashilkn1abbb0d5dd1d
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index bc55aa3448..e8f8e3f0a1 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -6,6 +6,7 @@ import "package:photos/models/social/reaction.dart";
import "package:photos/models/social/social_data_provider.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/theme/ente_theme.dart";
+import "package:photos/ui/components/buttons/icon_button_widget.dart";
import "package:photos/ui/social/widgets/comment_bubble_widget.dart";
import "package:photos/ui/social/widgets/comment_input_widget.dart";
import "package:uuid/uuid.dart";
@@ -187,17 +188,21 @@ class _CommentsScreenState extends State<CommentsScreen> {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
- titleSpacing: 16,
+ titleSpacing: 28,
backgroundColor: colorScheme.backgroundBase,
elevation: 0,
title: Text(
"${_comments.length} comments",
- style: textTheme.largeBold,
+ style: textTheme.bodyBold,
),
actions: [
- IconButton(
- icon: const Icon(Icons.close),
- onPressed: () => Navigator.of(context).pop(),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12),
+ child: IconButtonWidget(
+ iconButtonType: IconButtonType.rounded,
+ icon: Icons.close_rounded,
+ onTap: () => Navigator.of(context).pop(),
+ ),
),
const SizedBox(width: 4),
],
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_actions_capsule.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_actions_capsule.dart
index e9b0977eb3..86fe2c26d6 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_actions_capsule.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_actions_capsule.dart
@@ -3,13 +3,11 @@ import "package:photos/theme/ente_theme.dart";
class CommentActionsCapsule extends StatelessWidget {
final bool isLiked;
- final int likeCount;
final VoidCallback onLikeTap;
final VoidCallback onReplyTap;
const CommentActionsCapsule({
required this.isLiked,
- required this.likeCount,
required this.onLikeTap,
required this.onReplyTap,
super.key,
@@ -18,7 +16,6 @@ class CommentActionsCapsule extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
- final textTheme = getEnteTextTheme(context);
return Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
@@ -32,24 +29,10 @@ class CommentActionsCapsule extends StatelessWidget {
children: [
GestureDetector(
onTap: onLikeTap,
- child: Row(
- children: [
- Icon(
- isLiked ? Icons.favorite : Icons.favorite_border,
- size: 18,
- color:
- isLiked ? colorScheme.primary500 : colorScheme.textMuted,
- ),
- if (likeCount > 0) ...[
- const SizedBox(width: 2),
- Text(
- likeCount.toString(),
- style: textTheme.mini.copyWith(
- color: colorScheme.textMuted,
- ),
- ),
- ],
- ],
+ child: Icon(
+ isLiked ? Icons.favorite : Icons.favorite_border,
+ size: 18,
+ color: isLiked ? colorScheme.primary500 : colorScheme.textMuted,
),
),
const SizedBox(width: 12),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
index 56cd9839a5..e2ff332977 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
@@ -101,7 +101,7 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget> {
final bubbleTextColor =
widget.isOwnComment ? colorScheme.backgroundBase : colorScheme.textBase;
final bubbleBackgroundColor =
- widget.isOwnComment ? colorScheme.primary500 : colorScheme.fillBaseGrey;
+ widget.isOwnComment ? colorScheme.primary700 : colorScheme.fillBaseGrey;
return Padding(
padding: EdgeInsets.only(
@@ -140,7 +140,6 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget> {
: Alignment.centerLeft,
child: CommentActionsCapsule(
isLiked: _isLiked,
- likeCount: _reactions.where((r) => !r.isDeleted).length,
onLikeTap: _toggleLike,
onReplyTap: widget.onReplyTap,
),
@@ -159,10 +158,10 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget> {
required Color bubbleColor,
}) {
final bubbleBorderRadius = BorderRadius.only(
- topLeft: const Radius.circular(18),
- topRight: const Radius.circular(18),
- bottomLeft: Radius.circular(widget.isOwnComment ? 18 : 10),
- bottomRight: Radius.circular(widget.isOwnComment ? 10 : 18),
+ topLeft: Radius.circular(widget.isOwnComment ? 20 : 6),
+ topRight: Radius.circular(widget.isOwnComment ? 6 : 20),
+ bottomLeft: const Radius.circular(20),
+ bottomRight: const Radius.circular(20),
);
return Container(
@@ -183,9 +182,10 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget> {
),
Text(
widget.comment.data,
- style: textTheme.body.copyWith(
+ style: textTheme.small.copyWith(
color: textColor,
- height: 1.25,
+ height: 22 / 14,
+ fontWeight: FontWeight.w500,
),
),
],
@@ -229,11 +229,11 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget> {
),
child: Text(
parentText,
- style: textTheme.small.copyWith(
+ style: textTheme.tiny.copyWith(
+ height: 1.7,
color: widget.isOwnComment
? colorScheme.backgroundBase.withValues(alpha: 0.9)
: colorScheme.textMuted,
- height: 1.2,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
@@ -267,33 +267,50 @@ class _Header extends StatelessWidget {
alignment: Alignment.centerRight,
child: Text(
timestamp,
- style: textTheme.mini.copyWith(color: colorScheme.textMuted),
+ style: textTheme.tiny.copyWith(
+ color: colorScheme.textMuted,
+ height: 14 / 10,
+ fontWeight: FontWeight.w500,
+ ),
),
);
}
final headerText = Row(
mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.baseline,
+ textBaseline: TextBaseline.alphabetic,
children: [
Text(
name,
- style: textTheme.small.copyWith(color: colorScheme.textBase),
+ style: textTheme.small.copyWith(
+ color: colorScheme.textMuted,
+ height: 20 / 14,
+ fontWeight: FontWeight.w500,
+ ),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
- const SizedBox(width: 6),
- Container(
- width: 4,
- height: 4,
- decoration: BoxDecoration(
- color: colorScheme.textMuted,
- shape: BoxShape.circle,
+ const SizedBox(width: 4),
+ Transform.translate(
+ offset: const Offset(0, 1),
+ child: Text(
+ 'β€’',
+ style: textTheme.tiny.copyWith(
+ color: colorScheme.textMuted,
+ height: 1,
+ fontWeight: FontWeight.w600,
+ ),
),
),
- const SizedBox(width: 6),
+ const SizedBox(width: 4),
Text(
timestamp,
- style: textTheme.mini.copyWith(color: colorScheme.textMuted),
+ style: textTheme.tiny.copyWith(
+ color: colorScheme.textMuted,
+ height: 14 / 10,
+ fontWeight: FontWeight.w500,
+ ),
),
],
);