Skip to content

armgit / ente

Public Imported from GitHub
0

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

Improve likes bottom sheet styling and current user display

ashilkn9f884981e00e
diff --git a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
index 645d5daee1..92baee2aec 100644
--- a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
+++ b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
@@ -133,6 +133,7 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
currentUserID: widget.currentUserID,
thumbnailView: widget.thumbnailView,
type: widget.type,
+ addStroke: widget.addStroke,
),
);
} else if (snapshot.hasError) {
@@ -142,6 +143,7 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
currentUserID: widget.currentUserID,
thumbnailView: widget.thumbnailView,
type: widget.type,
+ addStroke: widget.addStroke,
);
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.data == null) {
@@ -150,6 +152,7 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
currentUserID: widget.currentUserID,
thumbnailView: widget.thumbnailView,
type: widget.type,
+ addStroke: widget.addStroke,
);
}
return const SizedBox.shrink();
@@ -162,6 +165,7 @@ class _UserAvatarWidgetState extends State<UserAvatarWidget> {
currentUserID: widget.currentUserID,
thumbnailView: widget.thumbnailView,
type: widget.type,
+ addStroke: widget.addStroke,
);
}
}
@@ -171,11 +175,13 @@ class _FirstLetterCircularAvatar extends StatefulWidget {
final int currentUserID;
final bool thumbnailView;
final AvatarType type;
+ final bool addStroke;
const _FirstLetterCircularAvatar({
required this.user,
required this.currentUserID,
required this.thumbnailView,
required this.type,
+ required this.addStroke,
});
@override
@@ -207,17 +213,19 @@ class _FirstLetterCircularAvatarState
final double size = avatarStyle.item1;
final TextStyle textStyle = avatarStyle.item2;
return Container(
- padding: const EdgeInsets.all(0.5),
- decoration: BoxDecoration(
- shape: BoxShape.circle,
- border: Border.all(
- color: widget.thumbnailView
- ? strokeMutedDark
- : getEnteColorScheme(context).strokeMuted,
- width: UserAvatarWidget.strokeWidth,
- strokeAlign: BorderSide.strokeAlignOutside,
- ),
- ),
+ padding: widget.addStroke ? const EdgeInsets.all(0.5) : EdgeInsets.zero,
+ decoration: widget.addStroke
+ ? BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: widget.thumbnailView
+ ? strokeMutedDark
+ : getEnteColorScheme(context).strokeMuted,
+ width: UserAvatarWidget.strokeWidth,
+ strokeAlign: BorderSide.strokeAlignOutside,
+ ),
+ )
+ : null,
child: SizedBox(
height: size,
width: size,
diff --git a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
index 50cb0f785d..2ee8474477 100644
--- a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
@@ -132,9 +132,11 @@ class _LikesBottomSheetState extends State<LikesBottomSheet> {
setState(() => _isLoading = true);
try {
- final likes = await SocialDataProvider.instance
- .getReactionsForFileInCollection(
- widget.fileID, _selectedCollectionID);
+ final likes =
+ await SocialDataProvider.instance.getReactionsForFileInCollection(
+ widget.fileID,
+ _selectedCollectionID,
+ );
if (mounted) {
setState(() {
@@ -358,7 +360,7 @@ class _LikeListItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final textTheme = getEnteTextTheme(context);
+ final colorScheme = getEnteColorScheme(context);
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
@@ -368,12 +370,21 @@ class _LikeListItem extends StatelessWidget {
user,
currentUserID: currentUserID,
type: AvatarType.lg,
+ addStroke: false,
),
const SizedBox(width: 12),
Expanded(
child: Text(
- user.displayName ?? user.email,
- style: textTheme.body,
+ user.id == currentUserID
+ ? "You"
+ : (user.displayName ?? user.email),
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.w500,
+ height: 20 / 14,
+ letterSpacing: 14 * -0.02,
+ color: colorScheme.textMuted,
+ ),
overflow: TextOverflow.ellipsis,
),
),