Skip to content

armgit / ente

Public Imported from GitHub
0

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

Refine Space empty post tiles

Anand Baburajana9bad7a2c06b
diff --git a/web/apps/space/src/components/PostUnreadBadge.tsx b/web/apps/space/src/components/PostUnreadBadge.tsx
index e57c6652b8..8ba06a9692 100644
--- a/web/apps/space/src/components/PostUnreadBadge.tsx
+++ b/web/apps/space/src/components/PostUnreadBadge.tsx
@@ -1,17 +1,24 @@
import { Box } from "@mui/material";
import React from "react";
-export const SpacePostUnreadBadge: React.FC<{ count: number }> = ({
- count,
+interface SpacePostBadgeProps extends React.PropsWithChildren {
+ backgroundColor: string;
+ color: string;
+}
+
+export const SpacePostBadge: React.FC<SpacePostBadgeProps> = ({
+ backgroundColor,
+ children,
+ color,
}) => (
<Box
component="span"
aria-hidden
sx={{
alignItems: "center",
- bgcolor: "#F63A3A",
+ bgcolor: backgroundColor,
borderRadius: "999px",
- color: "#FFFFFF",
+ color,
display: "inline-flex",
fontFamily: '"Inter Variable", Inter, sans-serif',
fontSize: 10,
@@ -30,6 +37,14 @@ export const SpacePostUnreadBadge: React.FC<{ count: number }> = ({
zIndex: 1,
}}
>
- {count}
+ {children}
</Box>
);
+
+export const SpacePostUnreadBadge: React.FC<{ count: number }> = ({
+ count,
+}) => (
+ <SpacePostBadge backgroundColor="#F63A3A" color="#FFFFFF">
+ {count}
+ </SpacePostBadge>
+);
diff --git a/web/apps/space/src/screens/HomeScreen.tsx b/web/apps/space/src/screens/HomeScreen.tsx
index f2658632b4..bf9ab7f539 100644
--- a/web/apps/space/src/screens/HomeScreen.tsx
+++ b/web/apps/space/src/screens/HomeScreen.tsx
@@ -13,7 +13,10 @@ import {
type SpaceViewerPostActionMode,
} from "components/FileViewer";
import { SpacePostFloatingActionButton } from "components/PostFloatingActionButton";
-import { SpacePostUnreadBadge } from "components/PostUnreadBadge";
+import {
+ SpacePostBadge,
+ SpacePostUnreadBadge,
+} from "components/PostUnreadBadge";
import { SpacePWAInstallPrompt } from "components/PWAInstallPrompt";
import { SpaceLoadingSpinner } from "components/RouteFallback";
import type { FriendProfile } from "data/friends";
@@ -491,21 +494,21 @@ const FriendPostCircle: React.FC<FriendPostCircleProps> = ({
</>
) : (
<Box
+ aria-hidden
sx={{
- alignItems: "center",
- background:
- "linear-gradient(145deg, #ECF7ED, #D9EDDC)",
- color: green,
- display: "flex",
- fontSize: 40,
- fontWeight: 700,
+ bgcolor: mediaPlaceholderColor,
height: "100%",
- justifyContent: "center",
width: "100%",
}}
+ />
+ )}
+ {(!post || postUnavailable) && (
+ <SpacePostBadge
+ backgroundColor="rgba(255, 255, 255, 0.1)"
+ color={textSecondary}
>
- {initial}
- </Box>
+ {postUnavailable ? "Unavailable" : "No posts yet"}
+ </SpacePostBadge>
)}
{!isRead && <SpacePostUnreadBadge count={posts.length} />}
</Box>
@@ -518,9 +521,12 @@ const FriendPostCircle: React.FC<FriendPostCircleProps> = ({
sx={{
appearance: "none",
bgcolor: "transparent",
- border: 0,
+ border: displayAvatarUrl
+ ? "2px solid rgba(255, 255, 255, 0.36)"
+ : "2px solid rgba(255, 255, 255, 0.12)",
borderRadius: "50%",
bottom: "10%",
+ boxSizing: "border-box",
cursor: onOpenFriend ? "pointer" : "default",
height: avatarSize,
left: "10%",
@@ -538,20 +544,30 @@ const FriendPostCircle: React.FC<FriendPostCircleProps> = ({
variant="circular"
sx={{
bgcolor: mediaPlaceholderColor,
- border: "2px solid rgba(255, 255, 255, 0.36)",
- boxSizing: "border-box",
height: "100%",
transform: "none",
width: "100%",
}}
/>
+ ) : displayAvatarUrl ? (
+ <SpaceAvatarImage aria-hidden src={displayAvatarUrl} />
) : (
- <SpaceAvatarImage
+ <Box
aria-hidden
- border="2px solid rgba(255, 255, 255, 0.36)"
- borderRadius="50%"
- src={displayAvatarUrl}
- />
+ sx={{
+ alignItems: "center",
+ bgcolor: "rgba(53, 65, 61, 0.72)",
+ color: "rgba(244, 244, 244, 0.72)",
+ display: "flex",
+ fontSize: 14,
+ fontWeight: 700,
+ height: "100%",
+ justifyContent: "center",
+ width: "100%",
+ }}
+ >
+ {initial}
+ </Box>
)}
</Box>
</Box>