Skip to content

armgit / ente

Public Imported from GitHub
0

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

Limit social profile click targets

Anand Baburajan5ee4ed6e255f
diff --git a/web/apps/social/src/components/SocialFileViewer.tsx b/web/apps/social/src/components/SocialFileViewer.tsx
index 75b74c2f27..b8f184e26f 100644
--- a/web/apps/social/src/components/SocialFileViewer.tsx
+++ b/web/apps/social/src/components/SocialFileViewer.tsx
@@ -621,46 +621,49 @@ const CommentItem: React.FC<CommentItemProps> = ({
>
{showHeader && (
<Box
- component={onOpenAuthorProfile ? "button" : "div"}
- type={onOpenAuthorProfile ? "button" : undefined}
- onClick={onOpenAuthorProfile}
sx={{
alignItems: "center",
- appearance: "none",
- bgcolor: "transparent",
- border: 0,
color: "inherit",
- cursor: onOpenAuthorProfile ? "pointer" : "default",
display: "flex",
- gap: "10px",
+ gap: "4px",
maxWidth: "min(calc(100vw - 32px), 360px)",
mb: "10px",
minWidth: 0,
- p: 0,
textAlign: "left",
width: "100%",
- "&:focus-visible": {
- borderRadius: "18px",
- outline: `2px solid ${green}`,
- outlineOffset: 3,
- },
}}
>
- <SocialAvatar
- avatarUrl={comment.avatarUrl}
- name={authorName}
- size={28}
- />
<Box
+ component={onOpenAuthorProfile ? "button" : "div"}
+ type={onOpenAuthorProfile ? "button" : undefined}
+ onClick={onOpenAuthorProfile}
sx={{
- alignItems: "baseline",
+ alignItems: "center",
+ appearance: "none",
+ bgcolor: "transparent",
+ border: 0,
+ color: "inherit",
+ cursor: onOpenAuthorProfile ? "pointer" : "default",
display: "flex",
- gap: "4px",
+ flex: "0 1 auto",
+ gap: "10px",
minWidth: 0,
- overflow: "hidden",
- whiteSpace: "nowrap",
+ p: 0,
+ textAlign: "left",
+ width: "fit-content",
+ maxWidth: "100%",
+ "&:focus-visible": {
+ borderRadius: "18px",
+ outline: `2px solid ${green}`,
+ outlineOffset: 3,
+ },
}}
>
+ <SocialAvatar
+ avatarUrl={comment.avatarUrl}
+ name={authorName}
+ size={28}
+ />
<Box
sx={{
color: textBase,
@@ -672,39 +675,38 @@ const CommentItem: React.FC<CommentItemProps> = ({
minWidth: 0,
overflow: "hidden",
textOverflow: "ellipsis",
+ whiteSpace: "nowrap",
}}
>
{authorName}
</Box>
- <Box
- aria-hidden
- sx={{
- color: commentsTimestamp,
- flexShrink: 0,
- fontFamily:
- '"Inter Variable", Inter, sans-serif',
- fontSize: 12,
- fontWeight: 600,
- lineHeight: "16px",
- }}
- >
- Β·
- </Box>
- <Box
- component="time"
- dateTime={timestampDateTime}
- sx={{
- color: commentsTimestamp,
- flexShrink: 0,
- fontFamily:
- '"Inter Variable", Inter, sans-serif',
- fontSize: 12,
- fontWeight: 600,
- lineHeight: "16px",
- }}
- >
- {timestampLabel}
- </Box>
+ </Box>
+ <Box
+ aria-hidden
+ sx={{
+ color: commentsTimestamp,
+ flexShrink: 0,
+ fontFamily: '"Inter Variable", Inter, sans-serif',
+ fontSize: 12,
+ fontWeight: 600,
+ lineHeight: "16px",
+ }}
+ >
+ Β·
+ </Box>
+ <Box
+ component="time"
+ dateTime={timestampDateTime}
+ sx={{
+ color: commentsTimestamp,
+ flexShrink: 0,
+ fontFamily: '"Inter Variable", Inter, sans-serif',
+ fontSize: 12,
+ fontWeight: 600,
+ lineHeight: "16px",
+ }}
+ >
+ {timestampLabel}
</Box>
</Box>
)}
@@ -1934,26 +1936,10 @@ export const SocialFileViewer: React.FC<SocialFileViewerProps> = ({
sx={{ listStyle: "none" }}
>
<Box
- component={
- canOpenFriend ? "button" : "div"
- }
- type={
- canOpenFriend
- ? "button"
- : undefined
- }
- onClick={openLikerProfile}
sx={{
alignItems: "center",
- appearance: "none",
- bgcolor: "transparent",
- border: 0,
- borderRadius: "12px",
boxSizing: "border-box",
color: "inherit",
- cursor: canOpenFriend
- ? "pointer"
- : "default",
display: "flex",
gap: "12px",
minHeight: 52,
@@ -1961,33 +1947,67 @@ export const SocialFileViewer: React.FC<SocialFileViewerProps> = ({
py: "8px",
textAlign: "left",
width: "100%",
- "&:focus-visible": {
- outline: `2px solid ${green}`,
- outlineOffset: 2,
- },
}}
>
- <SocialAvatar
- avatarUrl={liker.avatarUrl}
- name={likerName}
- size={36}
- />
<Box
+ component={
+ canOpenFriend
+ ? "button"
+ : "div"
+ }
+ type={
+ canOpenFriend
+ ? "button"
+ : undefined
+ }
+ onClick={openLikerProfile}
sx={{
- color: textBase,
- flex: "1 1 auto",
- fontFamily:
- '"Inter Variable", Inter, sans-serif',
- fontSize: 14,
- fontWeight: 600,
- lineHeight: "20px",
+ alignItems: "center",
+ appearance: "none",
+ bgcolor: "transparent",
+ border: 0,
+ borderRadius: "12px",
+ color: "inherit",
+ cursor: canOpenFriend
+ ? "pointer"
+ : "default",
+ display: "flex",
+ flex: "0 1 auto",
+ gap: "12px",
+ maxWidth: "100%",
minWidth: 0,
- overflow: "hidden",
- textOverflow: "ellipsis",
- whiteSpace: "nowrap",
+ p: 0,
+ textAlign: "left",
+ width: "fit-content",
+ "&:focus-visible": {
+ outline: `2px solid ${green}`,
+ outlineOffset: 2,
+ },
}}
>
- {likerName}
+ <SocialAvatar
+ avatarUrl={liker.avatarUrl}
+ name={likerName}
+ size={36}
+ />
+ <Box
+ sx={{
+ color: textBase,
+ flex: "0 1 auto",
+ fontFamily:
+ '"Inter Variable", Inter, sans-serif',
+ fontSize: 14,
+ fontWeight: 600,
+ lineHeight: "20px",
+ minWidth: 0,
+ overflow: "hidden",
+ textOverflow:
+ "ellipsis",
+ whiteSpace: "nowrap",
+ }}
+ >
+ {likerName}
+ </Box>
</Box>
<Box
aria-hidden
@@ -1996,6 +2016,7 @@ export const SocialFileViewer: React.FC<SocialFileViewerProps> = ({
display: "flex",
flexShrink: 0,
justifyContent: "center",
+ ml: "auto",
}}
>
<HeartFilledIcon />
diff --git a/web/apps/social/src/screens/FriendsScreen.tsx b/web/apps/social/src/screens/FriendsScreen.tsx
index f64440c359..1ed30f233f 100644
--- a/web/apps/social/src/screens/FriendsScreen.tsx
+++ b/web/apps/social/src/screens/FriendsScreen.tsx
@@ -81,22 +81,24 @@ const FriendRow: React.FC<FriendRowProps> = ({
}}
>
<Box
- component="button"
- type="button"
- onClick={() => onOpenFriend?.(friend.id)}
+ component={onOpenFriend ? "button" : "div"}
+ type={onOpenFriend ? "button" : undefined}
+ onClick={
+ onOpenFriend ? () => onOpenFriend(friend.id) : undefined
+ }
sx={{
alignItems: "center",
bgcolor: "transparent",
border: 0,
borderRadius: "12px",
cursor: onOpenFriend ? "pointer" : "default",
- display: "grid",
+ display: "flex",
gap: "12px",
- gridTemplateColumns: "48px minmax(0, 1fr)",
+ maxWidth: "100%",
minWidth: 0,
p: 0,
textAlign: "left",
- width: "100%",
+ width: "fit-content",
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 2,
@@ -110,6 +112,7 @@ const FriendRow: React.FC<FriendRowProps> = ({
borderRadius: "50%",
color: green,
display: "flex",
+ flexShrink: 0,
height: 48,
justifyContent: "center",
overflow: "hidden",
@@ -146,6 +149,7 @@ const FriendRow: React.FC<FriendRowProps> = ({
<Box
sx={{
display: "flex",
+ flex: "0 1 auto",
flexDirection: "column",
justifyContent: "center",
minWidth: 0,