Skip to content

armgit / ente

Public Imported from GitHub
0

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

Increase space touch targets

Anand Baburajan342e781a0cfb
diff --git a/web/apps/space/src/components/SpaceAvatarCropPage.tsx b/web/apps/space/src/components/SpaceAvatarCropPage.tsx
index da6bedb379..2eab91d94b 100644
--- a/web/apps/space/src/components/SpaceAvatarCropPage.tsx
+++ b/web/apps/space/src/components/SpaceAvatarCropPage.tsx
@@ -4,6 +4,7 @@ import { Box } from "@mui/material";
import { SpaceButtonSpinner } from "components/SpaceButtonSpinner";
import React from "react";
import Cropper, { type Area, type Point } from "react-easy-crop";
+import { spaceTouchTargetSize } from "styles/touchTargets";
const green = "#08C225";
const textBase = "#000";
@@ -205,15 +206,15 @@ export const SpaceAvatarCropPage: React.FC<SpaceAvatarCropPageProps> = ({
? {
alignItems: "center",
display: "grid",
- gridTemplateColumns: "24px 1fr 24px",
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: 56,
px: 2,
width: "100%",
}
: {
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
width: "100%",
}
}
@@ -233,11 +234,11 @@ export const SpaceAvatarCropPage: React.FC<SpaceAvatarCropPageProps> = ({
color: textBase,
cursor: isSaving ? "default" : "pointer",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -251,10 +252,10 @@ export const SpaceAvatarCropPage: React.FC<SpaceAvatarCropPageProps> = ({
color: textBase,
cursor: isSaving ? "default" : "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/components/SpaceAvatarEditButton.tsx b/web/apps/space/src/components/SpaceAvatarEditButton.tsx
index 269f89c166..a366c5b3b3 100644
--- a/web/apps/space/src/components/SpaceAvatarEditButton.tsx
+++ b/web/apps/space/src/components/SpaceAvatarEditButton.tsx
@@ -1,7 +1,9 @@
import { Box } from "@mui/material";
import React from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
const green = "#08C225";
+const editButtonVisualSize = 30;
const PencilIcon: React.FC = () => (
<Box
@@ -33,7 +35,6 @@ export const SpaceAvatarEditButton: React.FC<SpaceAvatarEditButtonProps> = ({
onClick,
}) => (
<Box
- className="green-bg"
component="button"
type="button"
aria-label={ariaLabel}
@@ -41,25 +42,39 @@ export const SpaceAvatarEditButton: React.FC<SpaceAvatarEditButtonProps> = ({
onClick={onClick}
sx={{
alignItems: "center",
- bgcolor: green,
+ bgcolor: "transparent",
border: 0,
borderRadius: "50%",
- bottom: 10,
- boxShadow: "0 1px 3px rgba(0, 0, 0, 0.08)",
+ bottom: 3,
color: "white",
cursor: disabled ? "default" : "pointer",
display: "flex",
- height: 30,
+ height: spaceTouchTargetSize,
justifyContent: "center",
position: "absolute",
- right: 2,
- width: 30,
+ right: -5,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 3,
},
}}
>
- <PencilIcon />
+ <Box
+ className="green-bg"
+ component="span"
+ sx={{
+ alignItems: "center",
+ bgcolor: green,
+ borderRadius: "50%",
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.08)",
+ display: "flex",
+ height: editButtonVisualSize,
+ justifyContent: "center",
+ width: editButtonVisualSize,
+ }}
+ >
+ <PencilIcon />
+ </Box>
</Box>
);
diff --git a/web/apps/space/src/components/SpaceFileViewer.tsx b/web/apps/space/src/components/SpaceFileViewer.tsx
index c88a70e88e..176e72e579 100644
--- a/web/apps/space/src/components/SpaceFileViewer.tsx
+++ b/web/apps/space/src/components/SpaceFileViewer.tsx
@@ -23,6 +23,7 @@ import {
} from "components/SpacePostLikeAnimation";
import type PhotoSwipe from "photoswipe";
import React from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import { firstNameFrom, formatSpaceDate } from "utils/spaceDisplay";
import { clampSpaceMessageText } from "utils/spaceMessageLimits";
import type { SpaceImageCropArea } from "utils/spacePostImage";
@@ -53,6 +54,7 @@ const defaultPhotoWidth = 900;
const defaultPhotoHeight = 680;
const viewerSwipeMinDeltaPx = 72;
const viewerSwipeAxisRatio = 1.5;
+const viewerHeaderAvatarSize = 28;
const postButtonSpin = keyframes`
from {
@@ -218,10 +220,10 @@ const viewerHeaderButtonSx = {
color: controlIcon,
cursor: "pointer",
display: "flex",
- height: 28,
+ height: spaceTouchTargetSize,
justifyContent: "center",
p: 0,
- width: 28,
+ width: spaceTouchTargetSize,
"&:focus-visible": { outline: `2px solid ${green}`, outlineOffset: 2 },
"&:hover": { bgcolor: controlBackgroundHover },
};
@@ -852,41 +854,49 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
cursor: onOpenProfile ? "pointer" : "default",
display: "flex",
flexShrink: 0,
- height: 28,
+ height: spaceTouchTargetSize,
justifyContent: "center",
- overflow: "hidden",
p: 0,
- width: 28,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 2,
},
}}
>
- {activePhoto.avatarUrl ? (
- <Box
- component="img"
- alt=""
- src={activePhoto.avatarUrl}
- sx={{
- display: "block",
- height: "100%",
- objectFit: "cover",
- objectPosition: "center",
- width: "100%",
- }}
- />
- ) : (
- <Skeleton
- variant="circular"
- sx={{
- bgcolor: avatarSkeletonBackground,
- height: "100%",
- transform: "none",
- width: "100%",
- }}
- />
- )}
+ <Box
+ sx={{
+ borderRadius: "50%",
+ height: viewerHeaderAvatarSize,
+ overflow: "hidden",
+ width: viewerHeaderAvatarSize,
+ }}
+ >
+ {activePhoto.avatarUrl ? (
+ <Box
+ component="img"
+ alt=""
+ src={activePhoto.avatarUrl}
+ sx={{
+ display: "block",
+ height: "100%",
+ objectFit: "cover",
+ objectPosition: "center",
+ width: "100%",
+ }}
+ />
+ ) : (
+ <Skeleton
+ variant="circular"
+ sx={{
+ bgcolor: avatarSkeletonBackground,
+ height: "100%",
+ transform: "none",
+ width: "100%",
+ }}
+ />
+ )}
+ </Box>
</Box>
<Box
sx={{
@@ -995,10 +1005,10 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
color: controlIcon,
cursor: "pointer",
display: "flex",
- height: 32,
+ height: spaceTouchTargetSize,
justifyContent: "center",
p: 0,
- width: 32,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -1070,7 +1080,7 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
color: dangerColor,
display: "flex",
gap: "8px",
- minHeight: 38,
+ minHeight: spaceTouchTargetSize,
px: "8px",
py: "7px",
whiteSpace: "nowrap",
diff --git a/web/apps/space/src/screens/CreateAccountScreen.tsx b/web/apps/space/src/screens/CreateAccountScreen.tsx
index dcbfc8ba44..11707d60eb 100644
--- a/web/apps/space/src/screens/CreateAccountScreen.tsx
+++ b/web/apps/space/src/screens/CreateAccountScreen.tsx
@@ -5,6 +5,7 @@ import {
type PasswordStrength,
} from "ente-accounts-rs/utils/password";
import React, { useId, useMemo, useState } from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const createAccountBackground = "#FAFAFA";
@@ -271,11 +272,11 @@ const TextInput: React.FC<TextInputProps> = ({
cursor: "pointer",
display: "flex",
flexShrink: 0,
- height: 32,
+ height: spaceTouchTargetSize,
justifyContent: "center",
mr: -0.5,
p: 0,
- width: 32,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -375,8 +376,8 @@ export const CreateAccountScreen: React.FC<CreateAccountScreenProps> = ({
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
mt: "32px",
width: "100%",
}}
@@ -393,10 +394,10 @@ export const CreateAccountScreen: React.FC<CreateAccountScreenProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/EditProfilePhotoScreen.tsx b/web/apps/space/src/screens/EditProfilePhotoScreen.tsx
index efa5227d88..27ff2ebb88 100644
--- a/web/apps/space/src/screens/EditProfilePhotoScreen.tsx
+++ b/web/apps/space/src/screens/EditProfilePhotoScreen.tsx
@@ -6,6 +6,7 @@ import { SpaceLoadingSpinner } from "components/SpaceRouteFallback";
import React, { useEffect, useRef, useState } from "react";
import type { Area, Point } from "react-easy-crop";
import { profileBackground } from "screens/ProfileScreen";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import {
prepareSpaceAvatarImageFromCrop,
prepareSpaceCoverImageFromCrop,
@@ -71,7 +72,7 @@ const EditProfilePhotoShell: React.FC<
sx={{
alignItems: "center",
display: "grid",
- gridTemplateColumns: "24px 1fr 24px",
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: 56,
px: 2,
width: "100%",
@@ -89,11 +90,11 @@ const EditProfilePhotoShell: React.FC<
color: textBase,
cursor: "pointer",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/FriendsScreen.tsx b/web/apps/space/src/screens/FriendsScreen.tsx
index 006678623c..b71ee9743e 100644
--- a/web/apps/space/src/screens/FriendsScreen.tsx
+++ b/web/apps/space/src/screens/FriendsScreen.tsx
@@ -12,6 +12,7 @@ import {
} from "components/SpaceActionFeedback";
import type { FriendProfile } from "data/friends";
import React, { useState } from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const friendsBackground = "#FFFFFF";
@@ -115,7 +116,7 @@ const FriendRow: React.FC<FriendRowProps> = ({
sx={{
alignItems: "center",
display: "grid",
- gridTemplateColumns: "minmax(0, 1fr) 32px",
+ gridTemplateColumns: `minmax(0, 1fr) ${spaceTouchTargetSize}px`,
gap: "12px",
listStyle: "none",
minHeight: 72,
@@ -246,11 +247,11 @@ const FriendRow: React.FC<FriendRowProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 32,
+ height: spaceTouchTargetSize,
justifyContent: "center",
justifySelf: "flex-end",
p: 0,
- width: 32,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 2,
@@ -292,7 +293,7 @@ const FriendRow: React.FC<FriendRowProps> = ({
borderRadius: "10px",
color: dangerColor,
gap: "8px",
- minHeight: 38,
+ minHeight: spaceTouchTargetSize,
px: "9px",
py: "7px",
whiteSpace: "nowrap",
@@ -455,7 +456,7 @@ export const FriendsScreen: React.FC<FriendsScreenProps> = ({
sx={{
alignItems: "center",
display: "grid",
- gridTemplateColumns: "24px 1fr 24px",
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: 56,
px: 2,
width: "100%",
@@ -473,11 +474,11 @@ export const FriendsScreen: React.FC<FriendsScreenProps> = ({
color: textBase,
cursor: onBack ? "pointer" : "default",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/HomeScreen.tsx b/web/apps/space/src/screens/HomeScreen.tsx
index b4c2fa53fd..60557240bd 100644
--- a/web/apps/space/src/screens/HomeScreen.tsx
+++ b/web/apps/space/src/screens/HomeScreen.tsx
@@ -32,6 +32,7 @@ import type {
SpacePostAvatarURLLoader,
} from "services/space";
import type { LocalSpaceFeedPost } from "state/spaceAppState";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import { createLoadedLocalPostPhoto } from "utils/localPostPhoto";
import { firstNameFrom, formatSpaceDate } from "utils/spaceDisplay";
import {
@@ -52,17 +53,17 @@ const feedSkeletonElementBackground = "#E6E6E6";
const textBase = "#000";
const textSecondary = "#6B6B6B";
const dangerColor = "#F63A3A";
-const headerActionSize = 32;
+const headerActionSize = spaceTouchTargetSize;
const headerAvatarSize = 27;
const feedAvatarSize = 38;
const headerHeight = 64;
const headerIconSize = 30;
const headerHideStartY = 96;
const headerScrollDelta = 4;
-const headerSideWidth = headerActionSize;
+const headerSideWidth = 32;
const floatingAddButtonSize = 64;
const floatingAddIconSize = 34;
-const feedLikeActionSize = 38;
+const feedLikeActionSize = spaceTouchTargetSize;
const feedActionIconSize = 20;
const feedReplyIconSize = 17;
const emptyFeedItemGap = "22px";
@@ -1228,11 +1229,11 @@ const AddedFriendToast: React.FC<AddedFriendToastProps> = ({
cursor: onClose ? "pointer" : "default",
display: "flex",
flexShrink: 0,
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "center",
opacity: 0.9,
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
outline: "2px solid rgba(0 0 0 / 0.72)",
outlineOffset: 2,
@@ -1744,6 +1745,7 @@ export const HomeScreen: React.FC<HomeScreenProps> = ({
height: headerActionSize,
justifyContent: "center",
lineHeight: 0,
+ ml: "-6px",
overflow: "hidden",
p: 0,
placeSelf: "center start",
@@ -1931,7 +1933,7 @@ export const HomeScreen: React.FC<HomeScreenProps> = ({
'"Inter Variable", Inter, sans-serif',
fontSize: 13,
fontWeight: 600,
- height: 36,
+ height: spaceTouchTargetSize,
justifyContent: "center",
lineHeight: "18px",
mb: 0,
@@ -2025,7 +2027,7 @@ export const HomeScreen: React.FC<HomeScreenProps> = ({
fontSize: 13,
fontWeight: 600,
gap: "6px",
- height: 36,
+ height: spaceTouchTargetSize,
justifyContent: "center",
lineHeight: "18px",
mt: emptyFeedItemGap,
diff --git a/web/apps/space/src/screens/LoginScreen.tsx b/web/apps/space/src/screens/LoginScreen.tsx
index c5940dc9a1..73da36f104 100644
--- a/web/apps/space/src/screens/LoginScreen.tsx
+++ b/web/apps/space/src/screens/LoginScreen.tsx
@@ -1,6 +1,7 @@
import { Box } from "@mui/material";
import { SpaceButtonSpinner } from "components/SpaceButtonSpinner";
import React, { useEffect, useRef, useState } from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const loginBackground = "#FAFAFA";
@@ -194,11 +195,11 @@ const TextInput: React.FC<TextInputProps> = ({
cursor: "pointer",
display: "flex",
flexShrink: 0,
- height: 32,
+ height: spaceTouchTargetSize,
justifyContent: "center",
mr: -0.5,
p: 0,
- width: 32,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -346,8 +347,8 @@ export const LoginScreen: React.FC<LoginScreenProps> = ({
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
mt: "32px",
width: "100%",
}}
@@ -365,10 +366,10 @@ export const LoginScreen: React.FC<LoginScreenProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/MessagesScreen.tsx b/web/apps/space/src/screens/MessagesScreen.tsx
index 1fe6ceeed0..4d454edf8b 100644
--- a/web/apps/space/src/screens/MessagesScreen.tsx
+++ b/web/apps/space/src/screens/MessagesScreen.tsx
@@ -12,6 +12,7 @@ import { flushSync } from "react-dom";
import type { SetupProfile } from "screens/SetupProfileScreen";
import { ShareIcon } from "screens/ShareProfileLinkScreen";
import type { SpaceMessage, SpaceMessageConversation } from "services/space";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import { firstNameFrom } from "utils/spaceDisplay";
import { clampSpaceMessageText } from "utils/spaceMessageLimits";
@@ -1046,11 +1047,10 @@ const MessageBubble: React.FC<{
sx={{
alignItems: "center",
appearance: "none",
- bgcolor: messagesBackground,
- border: `2px solid ${messagesBackground}`,
+ bgcolor: "transparent",
+ border: 0,
borderRadius: "999px",
- bottom: -11,
- boxShadow: "0 1px 3px rgba(0, 0, 0, 0.08)",
+ bottom: -22,
boxSizing: "border-box",
color: green,
cursor: "pointer",
@@ -1060,23 +1060,42 @@ const MessageBubble: React.FC<{
fontSize: 10,
fontWeight: 800,
gap: "4px",
- height: 22,
+ height: spaceTouchTargetSize,
justifyContent: "center",
lineHeight: 1,
- minWidth: 34,
- pb: "1px",
- px: "7px",
+ minWidth: spaceTouchTargetSize,
+ p: 0,
position: "absolute",
zIndex: 2,
- ...(isOwn ? { left: 8 } : { right: 8 }),
+ ...(isOwn ? { left: -3 } : { right: -3 }),
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 2,
},
}}
>
- <HeartIcon filled small />
- {message.likeCount}
+ <Box
+ component="span"
+ sx={{
+ alignItems: "center",
+ bgcolor: messagesBackground,
+ border: `2px solid ${messagesBackground}`,
+ borderRadius: "999px",
+ boxShadow:
+ "0 1px 3px rgba(0, 0, 0, 0.08)",
+ boxSizing: "border-box",
+ display: "inline-flex",
+ gap: "4px",
+ height: 22,
+ justifyContent: "center",
+ minWidth: 34,
+ pb: "1px",
+ px: "7px",
+ }}
+ >
+ <HeartIcon filled small />
+ {message.likeCount}
+ </Box>
</Box>
</Tooltip>
)}
@@ -1468,7 +1487,7 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
sx={{
alignItems: "center",
display: "grid",
- gridTemplateColumns: "24px 1fr 24px",
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: 56,
px: 2,
width: "100%",
@@ -1487,11 +1506,11 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
cursor:
isThreadOpen || onBack ? "pointer" : "default",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -1733,7 +1752,7 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
borderRadius: "12px",
color: textBase,
gap: "8px",
- minHeight: 38,
+ minHeight: spaceTouchTargetSize,
px: "8px",
py: "7px",
"&:hover": {
@@ -1765,7 +1784,7 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
borderRadius: "12px",
color: textBase,
gap: "8px",
- minHeight: 38,
+ minHeight: spaceTouchTargetSize,
px: "8px",
py: "7px",
"&:hover": {
@@ -1795,7 +1814,7 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
borderRadius: "12px",
color: textBase,
gap: "8px",
- minHeight: 38,
+ minHeight: spaceTouchTargetSize,
px: "8px",
py: "7px",
"&:hover": { bgcolor: lightSurface },
@@ -1829,7 +1848,7 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
borderRadius: "12px",
color: dangerColor,
gap: "8px",
- minHeight: 38,
+ minHeight: spaceTouchTargetSize,
px: "8px",
py: "7px",
"&:hover": {
@@ -1934,10 +1953,10 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
color: textSecondary,
cursor: "pointer",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "center",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 2,
@@ -2141,7 +2160,7 @@ export const MessagesScreen: React.FC<MessagesScreenProps> = ({
fontSize: 13,
fontWeight: 600,
gap: "6px",
- height: 36,
+ height: spaceTouchTargetSize,
justifyContent: "center",
lineHeight: "18px",
pointerEvents: "auto",
diff --git a/web/apps/space/src/screens/OnboardingScreen.tsx b/web/apps/space/src/screens/OnboardingScreen.tsx
index 5da3f83fa1..165a504090 100644
--- a/web/apps/space/src/screens/OnboardingScreen.tsx
+++ b/web/apps/space/src/screens/OnboardingScreen.tsx
@@ -1,6 +1,7 @@
import { Box } from "@mui/material";
import { EnteLogo } from "ente-base/components/EnteLogo";
import React, { useEffect, useRef, useState } from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const onboardingGreen = "#08C225";
export const onboardingTitle = "Share your life";
@@ -116,27 +117,40 @@ const OnboardingPaginationDots: React.FC<OnboardingPaginationDotsProps> = ({
aria-current={activeSlideIndex == index ? "page" : undefined}
onClick={() => onShowSlide(index)}
sx={{
- bgcolor:
- activeSlideIndex == index
- ? activePaginationGreen
- : inactivePaginationGreen,
+ alignItems: "center",
+ bgcolor: "transparent",
border: 0,
borderRadius: "999px",
cursor: "pointer",
- height: 10,
+ display: "flex",
+ height: spaceTouchTargetSize,
+ justifyContent: "center",
p: 0,
- transition:
- "background-color 180ms ease, height 180ms ease, width 180ms ease",
- width: activeSlideIndex == index ? 24 : 10,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
outline: "2px solid white",
outlineOffset: 4,
},
- "@media (prefers-reduced-motion: reduce)": {
- transition: "none",
- },
}}
- />
+ >
+ <Box
+ component="span"
+ sx={{
+ bgcolor:
+ activeSlideIndex == index
+ ? activePaginationGreen
+ : inactivePaginationGreen,
+ borderRadius: "999px",
+ height: 10,
+ transition:
+ "background-color 180ms ease, height 180ms ease, width 180ms ease",
+ width: activeSlideIndex == index ? 24 : 10,
+ "@media (prefers-reduced-motion: reduce)": {
+ transition: "none",
+ },
+ }}
+ />
+ </Box>
))}
</Box>
);
diff --git a/web/apps/space/src/screens/PasskeyVerificationScreen.tsx b/web/apps/space/src/screens/PasskeyVerificationScreen.tsx
index 3fd55235b1..64417474ba 100644
--- a/web/apps/space/src/screens/PasskeyVerificationScreen.tsx
+++ b/web/apps/space/src/screens/PasskeyVerificationScreen.tsx
@@ -1,6 +1,7 @@
import { Box } from "@mui/material";
import { SpaceButtonSpinner } from "components/SpaceButtonSpinner";
import React from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const passkeyVerificationBackground = "#FAFAFA";
@@ -94,8 +95,8 @@ export const PasskeyVerificationScreen: React.FC<
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
mt: "32px",
width: "100%",
}}
@@ -112,10 +113,10 @@ export const PasskeyVerificationScreen: React.FC<
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/ProfileImageViewerScreen.tsx b/web/apps/space/src/screens/ProfileImageViewerScreen.tsx
index 88e692ba0a..446b8e14b7 100644
--- a/web/apps/space/src/screens/ProfileImageViewerScreen.tsx
+++ b/web/apps/space/src/screens/ProfileImageViewerScreen.tsx
@@ -3,6 +3,7 @@ import { HugeiconsIcon } from "@hugeicons/react";
import { Box, Skeleton } from "@mui/material";
import React, { useRef } from "react";
import type { SetupProfile } from "screens/SetupProfileScreen";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import {
spaceAvatarImageInputAccept,
spaceCoverImageInputAccept,
@@ -90,7 +91,7 @@ export const ProfileImageViewerScreen: React.FC<
sx={{
alignItems: "center",
display: "grid",
- gridTemplateColumns: "24px 1fr 24px",
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: 56,
px: 2,
width: "100%",
@@ -108,11 +109,11 @@ export const ProfileImageViewerScreen: React.FC<
color: textBase,
cursor: "pointer",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/ProfileScreen.tsx b/web/apps/space/src/screens/ProfileScreen.tsx
index 399dffc14b..8ecd09e225 100644
--- a/web/apps/space/src/screens/ProfileScreen.tsx
+++ b/web/apps/space/src/screens/ProfileScreen.tsx
@@ -18,6 +18,7 @@ import React, { useState } from "react";
import type { SetupProfile } from "screens/SetupProfileScreen";
import { ShareIcon } from "screens/ShareProfileLinkScreen";
import type { SpacePostAsset } from "services/space";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import { createLoadedLocalPostPhoto } from "utils/localPostPhoto";
import { firstNameFrom } from "utils/spaceDisplay";
import {
@@ -973,7 +974,7 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
display: "grid",
gridTemplateColumns: isPublicProfile
? "1fr auto"
- : "24px 1fr 24px",
+ : `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: profileHeaderHeight,
position: "relative",
px: 2,
@@ -1026,11 +1027,11 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
color: "inherit",
cursor: "pointer",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -1062,7 +1063,7 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
'"Inter Variable", Inter, sans-serif',
fontSize: 13,
fontWeight: 700,
- height: 36,
+ height: spaceTouchTargetSize,
justifyContent: "center",
justifySelf: "flex-end",
lineHeight: "18px",
@@ -1114,10 +1115,10 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
color: "inherit",
cursor: onOpenSettings ? "pointer" : "default",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-end",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -1133,7 +1134,10 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
</Box>
) : (
!isPublicProfile && (
- <Box aria-hidden sx={{ width: 24 }} />
+ <Box
+ aria-hidden
+ sx={{ width: spaceTouchTargetSize }}
+ />
)
)}
</Box>
@@ -1271,12 +1275,12 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
: "default",
display: "flex",
gridColumn: 3,
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "center",
justifySelf: "start",
ml: "4px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -1582,7 +1586,7 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({
fontSize: 14,
fontWeight: 600,
gap: "8px",
- height: 40,
+ height: spaceTouchTargetSize,
justifyContent: "center",
lineHeight: "20px",
mt: "24px",
diff --git a/web/apps/space/src/screens/SettingsScreen.tsx b/web/apps/space/src/screens/SettingsScreen.tsx
index 3fd094ba76..780d7ff6cc 100644
--- a/web/apps/space/src/screens/SettingsScreen.tsx
+++ b/web/apps/space/src/screens/SettingsScreen.tsx
@@ -9,6 +9,7 @@ import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";
import { Box } from "@mui/material";
import { ConfirmationActionSheet } from "components/ConfirmationActionSheet";
import React from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const settingsBackground = "#FAFAFA";
@@ -170,12 +171,12 @@ const SpaceIcon: React.FC<SpaceIconProps> = ({ label, src, url }) => (
borderRadius: "10px",
cursor: "pointer",
display: "flex",
- height: 36,
+ height: spaceTouchTargetSize,
justifyContent: "center",
p: 0,
textDecoration: "none",
transition: "background-color 120ms ease",
- width: 36,
+ width: spaceTouchTargetSize,
"&:active": { bgcolor: "rgba(0, 0, 0, 0.025)" },
"&:focus-visible": {
outline: `2px solid ${green}`,
@@ -234,7 +235,7 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
sx={{
alignItems: "center",
display: "grid",
- gridTemplateColumns: "24px 1fr 24px",
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
height: 56,
px: 2,
width: "100%",
@@ -252,11 +253,11 @@ export const SettingsScreen: React.FC<SettingsScreenProps> = ({
color: textBase,
cursor: onBack ? "pointer" : "default",
display: "flex",
- height: 24,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
ml: "-2px",
p: 0,
- width: 24,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/SetupProfileScreen.tsx b/web/apps/space/src/screens/SetupProfileScreen.tsx
index 1d331a765f..8590f9f052 100644
--- a/web/apps/space/src/screens/SetupProfileScreen.tsx
+++ b/web/apps/space/src/screens/SetupProfileScreen.tsx
@@ -6,6 +6,7 @@ import { SpaceAvatarEditButton } from "components/SpaceAvatarEditButton";
import { SpaceButtonSpinner } from "components/SpaceButtonSpinner";
import React, { useEffect, useRef, useState } from "react";
import type { Area, Point } from "react-easy-crop";
+import { spaceTouchTargetSize } from "styles/touchTargets";
import {
prepareSpaceAvatarImageFromCrop,
spaceAvatarCropImageForFile,
@@ -465,8 +466,8 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
mt: "32px",
width: "100%",
}}
@@ -483,10 +484,10 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/ShareProfileLinkScreen.tsx b/web/apps/space/src/screens/ShareProfileLinkScreen.tsx
index bd0e947c00..08f54b815e 100644
--- a/web/apps/space/src/screens/ShareProfileLinkScreen.tsx
+++ b/web/apps/space/src/screens/ShareProfileLinkScreen.tsx
@@ -3,6 +3,7 @@ import { HugeiconsIcon } from "@hugeicons/react";
import { Box, Skeleton } from "@mui/material";
import React, { useState } from "react";
import type { SetupProfile } from "screens/SetupProfileScreen";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const shareProfileLinkBackground = "#FAFAFA";
@@ -237,8 +238,8 @@ export const ShareProfileLinkScreen: React.FC<ShareProfileLinkScreenProps> = ({
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px minmax(0, 1fr) 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px minmax(0, 1fr) ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
minWidth: 0,
mt: "32px",
width: "100%",
@@ -256,10 +257,10 @@ export const ShareProfileLinkScreen: React.FC<ShareProfileLinkScreenProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/screens/VerifyEmailScreen.tsx b/web/apps/space/src/screens/VerifyEmailScreen.tsx
index fdef81636c..6ab5219be0 100644
--- a/web/apps/space/src/screens/VerifyEmailScreen.tsx
+++ b/web/apps/space/src/screens/VerifyEmailScreen.tsx
@@ -1,6 +1,7 @@
import { Box } from "@mui/material";
import { SpaceButtonSpinner } from "components/SpaceButtonSpinner";
import React, { useEffect, useRef, useState } from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const verifyEmailBackground = "#FAFAFA";
@@ -266,8 +267,8 @@ export const VerifyEmailScreen: React.FC<VerifyEmailScreenProps> = ({
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
mt: "32px",
width: "100%",
}}
@@ -284,10 +285,10 @@ export const VerifyEmailScreen: React.FC<VerifyEmailScreenProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
@@ -436,11 +437,14 @@ export const VerifyEmailScreen: React.FC<VerifyEmailScreenProps> = ({
border: 0,
color: textLight,
cursor: "pointer",
+ display: "inline-flex",
fontFamily:
'"Inter Variable", Inter, sans-serif',
fontSize: 14,
fontWeight: 500,
+ alignItems: "center",
lineHeight: "20px",
+ minHeight: spaceTouchTargetSize,
p: 0,
textDecoration: "underline",
textUnderlineOffset: "2px",
@@ -469,11 +473,14 @@ export const VerifyEmailScreen: React.FC<VerifyEmailScreenProps> = ({
cursor: isResending
? "default"
: "pointer",
+ display: "inline-flex",
fontFamily:
'"Inter Variable", Inter, sans-serif',
fontSize: 14,
fontWeight: 500,
+ alignItems: "center",
lineHeight: "20px",
+ minHeight: spaceTouchTargetSize,
minWidth: 84,
p: 0,
textDecoration: "underline",
diff --git a/web/apps/space/src/screens/VerifyTwoFactorScreen.tsx b/web/apps/space/src/screens/VerifyTwoFactorScreen.tsx
index 16de010500..a9da0b2bb7 100644
--- a/web/apps/space/src/screens/VerifyTwoFactorScreen.tsx
+++ b/web/apps/space/src/screens/VerifyTwoFactorScreen.tsx
@@ -3,6 +3,7 @@ import { HugeiconsIcon } from "@hugeicons/react";
import { Box } from "@mui/material";
import { SpaceButtonSpinner } from "components/SpaceButtonSpinner";
import React, { useEffect, useRef, useState } from "react";
+import { spaceTouchTargetSize } from "styles/touchTargets";
export const verifyTwoFactorBackground = "#FAFAFA";
@@ -250,8 +251,8 @@ export const VerifyTwoFactorScreen: React.FC<VerifyTwoFactorScreenProps> = ({
component="header"
sx={{
display: "grid",
- gridTemplateColumns: "42px 1fr 42px",
- height: 42,
+ gridTemplateColumns: `${spaceTouchTargetSize}px 1fr ${spaceTouchTargetSize}px`,
+ height: spaceTouchTargetSize,
mt: "32px",
width: "100%",
}}
@@ -268,10 +269,10 @@ export const VerifyTwoFactorScreen: React.FC<VerifyTwoFactorScreenProps> = ({
color: textBase,
cursor: "pointer",
display: "flex",
- height: 42,
+ height: spaceTouchTargetSize,
justifyContent: "flex-start",
p: 0,
- width: 42,
+ width: spaceTouchTargetSize,
"&:focus-visible": {
borderRadius: "50%",
outline: `2px solid ${green}`,
diff --git a/web/apps/space/src/styles/touchTargets.ts b/web/apps/space/src/styles/touchTargets.ts
new file mode 100644
index 0000000000..a66077d778
--- /dev/null
+++ b/web/apps/space/src/styles/touchTargets.ts
@@ -0,0 +1 @@
+export const spaceTouchTargetSize = 44;