Skip to content

armgit / ente

Public Imported from GitHub
0

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

Update Space setup profile UI

Anand Baburajan1e3d5882d02d
diff --git a/web/apps/space/src/components/SpaceAvatarEditButton.tsx b/web/apps/space/src/components/SpaceAvatarEditButton.tsx
index 93e6fd7c87..269f89c166 100644
--- a/web/apps/space/src/components/SpaceAvatarEditButton.tsx
+++ b/web/apps/space/src/components/SpaceAvatarEditButton.tsx
@@ -2,14 +2,13 @@ import { Box } from "@mui/material";
import React from "react";
const green = "#08C225";
-const textBase = "#000";
const PencilIcon: React.FC = () => (
<Box
component="svg"
viewBox="0 0 24 24"
aria-hidden
- sx={{ display: "block", height: 16, width: 16 }}
+ sx={{ display: "block", height: 18, width: 18 }}
>
<path
d="M14.25 5.25L18.75 9.75M4.75 19.25L8.9 18.45L19.35 8C20.25 7.1 20.25 5.65 19.35 4.75C18.45 3.85 17 3.85 16.1 4.75L5.65 15.2L4.75 19.25Z"
@@ -34,6 +33,7 @@ export const SpaceAvatarEditButton: React.FC<SpaceAvatarEditButtonProps> = ({
onClick,
}) => (
<Box
+ className="green-bg"
component="button"
type="button"
aria-label={ariaLabel}
@@ -41,19 +41,19 @@ export const SpaceAvatarEditButton: React.FC<SpaceAvatarEditButtonProps> = ({
onClick={onClick}
sx={{
alignItems: "center",
- bgcolor: "white",
+ bgcolor: green,
border: 0,
borderRadius: "50%",
bottom: 10,
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.08)",
- color: textBase,
+ color: "white",
cursor: disabled ? "default" : "pointer",
display: "flex",
- height: 26,
+ height: 30,
justifyContent: "center",
position: "absolute",
right: 2,
- width: 26,
+ width: 30,
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 3,
diff --git a/web/apps/space/src/screens/SetupProfileScreen.tsx b/web/apps/space/src/screens/SetupProfileScreen.tsx
index 7e0931faf7..1d331a765f 100644
--- a/web/apps/space/src/screens/SetupProfileScreen.tsx
+++ b/web/apps/space/src/screens/SetupProfileScreen.tsx
@@ -1,3 +1,5 @@
+import { User02Icon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";
import { Box } from "@mui/material";
import { SpaceAvatarCropPage } from "components/SpaceAvatarCropPage";
import { SpaceAvatarEditButton } from "components/SpaceAvatarEditButton";
@@ -17,8 +19,18 @@ const green = "#08C225";
const textBase = "#000";
const textLight = "#969696";
const warning = "#F63A3A";
-const paleGreen = "#E7F6E9";
const setupProfileFormID = "space-setup-profile-form";
+const filledUser02BodyPath =
+ "M18.5 20V16.5C18.5 15.2577 17.9407 14.0395 16.8103 13.5242C15.4315 12.8957 13.7779 12.5296 12 12.5296C10.2221 12.5296 8.5685 12.8957 7.18968 13.5242C6.05927 14.0395 5.5 15.2577 5.5 16.5V20";
+const filledUserIcon = User02Icon.map(([tag, attrs]) => [
+ tag,
+ {
+ ...attrs,
+ d: attrs.key == "0" ? filledUser02BodyPath : attrs.d,
+ fill: "currentColor",
+ stroke: "none",
+ },
+]) as IconSvgElement;
export interface SetupProfile {
avatarUrl: string | null;
@@ -80,27 +92,26 @@ const BackIcon: React.FC = () => (
</Box>
);
-const UploadIcon: React.FC = () => (
+const AvatarPlaceholder: React.FC = () => (
<Box
- component="svg"
- viewBox="0 0 24 24"
aria-hidden
- sx={{ display: "block", height: 40, width: 40 }}
+ sx={{
+ alignItems: "center",
+ bgcolor: "#C8D2DB",
+ border: "4px solid white",
+ borderRadius: "50%",
+ color: "white",
+ display: "flex",
+ height: "100%",
+ justifyContent: "center",
+ overflow: "hidden",
+ width: "100%",
+ }}
>
- <path
- d="M8.5 7.5L9.75 5.75H14.25L15.5 7.5H18C19.1 7.5 20 8.4 20 9.5V17C20 18.1 19.1 19 18 19H6C4.9 19 4 18.1 4 17V9.5C4 8.4 4.9 7.5 6 7.5H8.5Z"
- fill="none"
- stroke="currentColor"
- strokeLinejoin="round"
- strokeWidth="1.8"
- />
- <circle
- cx="12"
- cy="13"
- fill="none"
- r="3"
- stroke="currentColor"
- strokeWidth="1.8"
+ <HugeiconsIcon
+ icon={filledUserIcon}
+ size={120}
+ style={{ transform: "translateY(18px)" }}
/>
</Box>
);
@@ -267,6 +278,7 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
!isApplyingAvatarCrop &&
!isPreparingAvatar &&
usernameStatus != "unavailable" &&
+ Boolean(avatarUrl) &&
username.trim().length > 0 &&
fullName.trim().length > 0;
const isContinueButtonActive = canContinue || isSubmitting;
@@ -531,10 +543,10 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
sx={{
alignItems: "center",
aspectRatio: "1 / 1",
- bgcolor: avatarUrl ? "transparent" : paleGreen,
+ bgcolor: "transparent",
border: 0,
borderRadius: "50%",
- color: green,
+ color: textBase,
cursor: isPreparingAvatar
? "default"
: "pointer",
@@ -555,7 +567,7 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
<Box
component="span"
sx={{
- color: green,
+ color: textLight,
fontFamily:
'"Inter Variable", Inter, sans-serif',
fontSize: 13,
@@ -579,7 +591,7 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
}}
/>
) : (
- <UploadIcon />
+ <AvatarPlaceholder />
)}
</Box>
<SpaceAvatarEditButton
@@ -597,23 +609,23 @@ export const SetupProfileScreen: React.FC<SetupProfileScreenProps> = ({
width: "100%",
}}
>
+ <TextInput
+ label="Name"
+ onChange={setFullName}
+ placeholder="Enter your name"
+ required
+ value={fullName}
+ />
<TextInput
endAdornment={
<UsernameStatusIcon status={usernameStatus} />
}
label="Username"
onChange={handleUsernameChange}
- placeholder="Choose a username"
+ placeholder="Choose your username"
required
value={username}
/>
- <TextInput
- label="Full name"
- onChange={setFullName}
- placeholder="Enter your full name"
- required
- value={fullName}
- />
{(avatarError || errorMessage) && (
<Box
role="alert"