Skip to content

armgit / ente

Public Imported from GitHub
0

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

Make UI of CommentActionsPopup similar to figma

ashilkn11f47837c520
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart
index 6f8a83b84c..7313c527b0 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart
@@ -21,50 +21,49 @@ class CommentActionsPopup extends StatelessWidget {
final backgroundColor = isDarkMode ? const Color(0xFF1C1C1E) : Colors.white;
- return Material(
- color: Colors.transparent,
- child: Container(
- decoration: BoxDecoration(
- color: backgroundColor,
- borderRadius: BorderRadius.circular(12),
- boxShadow: [
- BoxShadow(
- color: Colors.black.withValues(alpha: 0.15),
- blurRadius: 16,
- offset: const Offset(0, 4),
+ return Container(
+ padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
+ decoration: BoxDecoration(
+ color: backgroundColor,
+ borderRadius: BorderRadius.circular(10),
+ ),
+ child: IntrinsicWidth(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ _ActionItem(
+ icon: isLiked ? Icons.favorite : Icons.favorite_border,
+ iconColor: isLiked ? const Color(0xFFE25454) : null,
+ label: "Like",
+ onTap: onLikeTap,
+ textStyle: textTheme.mini.copyWith(
+ height: 19 / 12,
+ letterSpacing: -0.36,
+ ),
+ defaultIconColor: colorScheme.textBase,
),
- ],
- ),
- child: ClipRRect(
- borderRadius: BorderRadius.circular(12),
- child: IntrinsicWidth(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- _ActionItem(
- icon: isLiked ? Icons.favorite : Icons.favorite_border,
- iconColor: isLiked ? const Color(0xFFE25454) : null,
- label: "Like",
- onTap: onLikeTap,
- textStyle: textTheme.body,
- defaultIconColor: colorScheme.textBase,
- ),
- Divider(
- height: 1,
- thickness: 1,
- color: colorScheme.strokeFaint,
- ),
- _ActionItem(
- icon: Icons.reply,
- label: "Reply",
- onTap: onReplyTap,
- textStyle: textTheme.body,
- defaultIconColor: colorScheme.textBase,
- ),
- ],
+ _ActionItem(
+ icon: Icons.reply,
+ label: "Reply",
+ onTap: onReplyTap,
+ textStyle: textTheme.mini.copyWith(
+ height: 19 / 12,
+ letterSpacing: -0.36,
+ ),
+ defaultIconColor: colorScheme.textBase,
),
- ),
+ _ActionItem(
+ icon: Icons.delete_outline_rounded,
+ label: "Delete",
+ onTap: () {},
+ textStyle: textTheme.mini.copyWith(
+ height: 19 / 12,
+ letterSpacing: -0.36,
+ ),
+ defaultIconColor: colorScheme.textBase,
+ ),
+ ],
),
),
);
@@ -93,16 +92,16 @@ class _ActionItem extends StatelessWidget {
return InkWell(
onTap: onTap,
child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ padding: const EdgeInsets.fromLTRB(16, 4, 40, 4),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
icon,
- size: 20,
+ size: 16,
color: iconColor ?? defaultIconColor,
),
- const SizedBox(width: 12),
+ const SizedBox(width: 8),
Text(
label,
style: textStyle.copyWith(
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 8a0ed3e8b0..fcfb948eab 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
@@ -208,81 +208,86 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
top: includePadding ? 8 : 0,
bottom: includePadding ? 8 : 0,
),
- child: Column(
- crossAxisAlignment: widget.isOwnComment
- ? CrossAxisAlignment.end
- : CrossAxisAlignment.start,
- children: [
- Opacity(
- opacity: showHeader ? 1 : 0,
- child: Padding(
- padding: EdgeInsets.only(
- right: widget.isOwnComment ? 18 : 0,
- ),
- child: _Header(
- isOwnComment: widget.isOwnComment,
- user: widget.user,
- createdAt: widget.comment.createdAt,
- currentUserID: widget.currentUserID,
+ child: IntrinsicWidth(
+ child: Column(
+ crossAxisAlignment: widget.isOwnComment
+ ? CrossAxisAlignment.end
+ : CrossAxisAlignment.start,
+ children: [
+ Opacity(
+ opacity: showHeader ? 1 : 0,
+ child: Padding(
+ padding: EdgeInsets.only(
+ right: widget.isOwnComment ? 18 : 0,
+ ),
+ child: _Header(
+ isOwnComment: widget.isOwnComment,
+ user: widget.user,
+ createdAt: widget.comment.createdAt,
+ currentUserID: widget.currentUserID,
+ ),
),
),
- ),
- const SizedBox(height: 12),
- Padding(
- padding: EdgeInsets.only(left: widget.isOwnComment ? 0 : 24),
- child: Stack(
- children: [
- Padding(
- padding: showActionsCapsule
- ? const EdgeInsets.only(right: 16, bottom: 17)
- : EdgeInsets.zero,
- child: Transform.scale(
- scale: bubbleScale,
- alignment: widget.isOwnComment
- ? Alignment.topRight
- : Alignment.topLeft,
- child: _CommentBubble(
- comment: widget.comment,
- isOwnComment: widget.isOwnComment,
- isLoadingParent: _isLoadingParent,
- parentComment: _parentComment,
- currentUserID: widget.currentUserID,
- userResolver: widget.userResolver,
- ),
+ const SizedBox(height: 12),
+ Padding(
+ padding: EdgeInsets.only(left: widget.isOwnComment ? 0 : 24),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Stack(
+ children: [
+ Padding(
+ padding: showActionsCapsule
+ ? const EdgeInsets.only(right: 16, bottom: 17)
+ : EdgeInsets.zero,
+ child: Transform.scale(
+ scale: bubbleScale,
+ alignment: widget.isOwnComment
+ ? Alignment.topRight
+ : Alignment.topLeft,
+ child: _CommentBubble(
+ comment: widget.comment,
+ isOwnComment: widget.isOwnComment,
+ isLoadingParent: _isLoadingParent,
+ parentComment: _parentComment,
+ currentUserID: widget.currentUserID,
+ userResolver: widget.userResolver,
+ ),
+ ),
+ ),
+ if (!_isLoadingReactions && showActionsCapsule)
+ Positioned(
+ right: 0,
+ bottom: 0,
+ child: CommentActionsCapsule(
+ isLiked: _isLiked,
+ onLikeTap: _toggleLike,
+ onReplyTap: widget.onReplyTap,
+ ),
+ ),
+ ],
),
- ),
- if (!_isLoadingReactions && showActionsCapsule)
- Positioned(
- right: 0,
- bottom: 0,
- child: CommentActionsCapsule(
- isLiked: _isLiked,
- onLikeTap: _toggleLike,
- onReplyTap: widget.onReplyTap,
+ if (showActionsPopup)
+ Padding(
+ padding: const EdgeInsets.only(top: 8),
+ child: CommentActionsPopup(
+ isLiked: _isLiked,
+ onLikeTap: () {
+ _hideHighlight();
+ _toggleLike();
+ },
+ onReplyTap: () {
+ _hideHighlight();
+ widget.onReplyTap();
+ },
+ ),
),
- ),
- ],
- ),
- ),
- if (showActionsPopup)
- Padding(
- padding: EdgeInsets.only(
- left: widget.isOwnComment ? 0 : 24,
- top: 8,
- ),
- child: CommentActionsPopup(
- isLiked: _isLiked,
- onLikeTap: () {
- _hideHighlight();
- _toggleLike();
- },
- onReplyTap: () {
- _hideHighlight();
- widget.onReplyTap();
- },
+ ],
),
),
- ],
+ ],
+ ),
),
);
}