Skip to content

armgit / ente

Public Imported from GitHub
0

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

Adjust home circle ring spacing

Anand Baburajan8627a3c95410
diff --git a/web/apps/space/src/components/CircleNameArc.tsx b/web/apps/space/src/components/CircleNameArc.tsx
index 273b8cc8d6..8274f12571 100644
--- a/web/apps/space/src/components/CircleNameArc.tsx
+++ b/web/apps/space/src/components/CircleNameArc.tsx
@@ -5,6 +5,7 @@ export type SpaceCircleNameArcPosition = "upper-left" | "top" | "upper-right";
interface SpaceCircleNameArcProps {
id: string;
name: string;
+ nameInset: number;
position: SpaceCircleNameArcPosition;
ringColor: string;
ringWidth: number;
@@ -14,6 +15,7 @@ interface SpaceCircleNameArcProps {
export const SpaceCircleNameArc: React.FC<SpaceCircleNameArcProps> = ({
id,
name,
+ nameInset,
position,
ringColor,
ringWidth,
@@ -21,7 +23,7 @@ export const SpaceCircleNameArc: React.FC<SpaceCircleNameArcProps> = ({
}) => {
const center = size / 2;
const fontSize = Math.max(8, Math.min(11, size * 0.065));
- const radius = center - fontSize * 0.2;
+ const radius = center - fontSize * 0.2 - nameInset;
const arcCenterAngle =
position == "upper-left"
? (Math.PI * 5) / 4
diff --git a/web/apps/space/src/pages/layout-demo.tsx b/web/apps/space/src/pages/layout-demo.tsx
index 3b23b49825..4d4aa44e31 100644
--- a/web/apps/space/src/pages/layout-demo.tsx
+++ b/web/apps/space/src/pages/layout-demo.tsx
@@ -78,6 +78,7 @@ const LayoutDemoPage: React.FC = () => {
);
const circleSize = placements[0]?.size ?? 0;
const ringWidth = Math.max(1, Math.min(3, circleSize * 0.018));
+ const circlePadding = Math.max(3, Math.min(7, circleSize * 0.04));
return (
<Box
@@ -227,19 +228,30 @@ const LayoutDemoPage: React.FC = () => {
>
<Box
sx={{
- bgcolor: "#1A211F",
+ aspectRatio: "1",
border: 0,
borderRadius: "50%",
boxSizing: "border-box",
height: "100%",
+ p: `${ringWidth + circlePadding}px`,
position: "relative",
width: "100%",
zIndex: 1,
}}
- />
+ >
+ <Box
+ sx={{
+ bgcolor: "#1A211F",
+ borderRadius: "50%",
+ height: "100%",
+ width: "100%",
+ }}
+ />
+ </Box>
<SpaceCircleNameArc
id={`layout-name-arc-${index}`}
name={sampleNames[index]!}
+ nameInset={circlePadding * 0.45}
position={
Math.abs(
x +
diff --git a/web/apps/space/src/screens/HomeScreen.tsx b/web/apps/space/src/screens/HomeScreen.tsx
index 06aef87ae0..45031a2b87 100644
--- a/web/apps/space/src/screens/HomeScreen.tsx
+++ b/web/apps/space/src/screens/HomeScreen.tsx
@@ -278,7 +278,7 @@ const FriendPostCircle: React.FC<FriendPostCircleProps> = ({
const isCircleDisabled =
isLoading || Boolean(post && !postUnavailable && !isPhotoReady);
const circleBorderWidth = Math.max(1, Math.min(3, placement.size * 0.018));
- const circlePadding = Math.max(1.5, Math.min(4, placement.size * 0.025));
+ const circlePadding = Math.max(3, Math.min(7, placement.size * 0.04));
React.useEffect(() => {
if (isLoading || !post || postUnavailable || shouldLoadMedia) return;
@@ -483,6 +483,7 @@ const FriendPostCircle: React.FC<FriendPostCircleProps> = ({
<SpaceCircleNameArc
id={nameArcID}
name={firstName}
+ nameInset={circlePadding * 0.45}
position={nameArcPosition}
ringColor={inactivePostCircleBorderColor}
ringWidth={circleBorderWidth}