π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Add social settings and profile actions
Anand Baburajan53ffdfee67fa
diff --git a/web/apps/social/package.json b/web/apps/social/package.jsonindex f22abd7256..00ee4f18e9 100644--- a/web/apps/social/package.json+++ b/web/apps/social/package.json@@ -3,6 +3,8 @@"version": "0.0.0","private": true,"dependencies": {+ "@hugeicons/core-free-icons": "^1.1.0",+ "@hugeicons/react": "^1.1.4","ente-base": "*"},"devDependencies": {diff --git a/web/apps/social/public/images/discord.svg b/web/apps/social/public/images/discord.svgnew file mode 100644index 0000000000..a94254dc4e--- /dev/null+++ b/web/apps/social/public/images/discord.svg@@ -0,0 +1,6 @@+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M12.4006 14.2004L13.4353 15.6168C13.5324 15.7705 13.7191 15.8392 13.8895 15.7783C14.5325 15.5486 16.1264 14.9261 17.4387 13.9784C17.541 13.9045 17.6001 13.7813 17.5993 13.6542C17.5993 6.60039 15.6006 4.60039 15.6006 4.60039C15.6006 4.60039 14.0006 3.68209 12.2837 3.40521C12.1148 3.37796 11.9494 3.46846 11.8743 3.62352L11.5183 4.35781C11.5183 4.35781 10.6282 4.17157 9.59995 4.17157C8.57171 4.17157 7.68163 4.35781 7.68163 4.35781L7.32564 3.62352C7.25047 3.46846 7.08511 3.37796 6.91619 3.40521C5.20059 3.68189 3.60059 4.60039 3.60059 4.60039C3.60059 4.60039 1.60059 6.60039 1.60059 13.6542C1.59979 13.7813 1.65887 13.9045 1.76123 13.9784C3.07352 14.9261 4.66739 15.5486 5.3104 15.7783C5.48079 15.8392 5.66745 15.7705 5.76461 15.6168L6.80059 14.2004" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M14.0007 13.4004C14.0007 13.4004 12.1646 14.6004 9.60069 14.6004C7.03675 14.6004 5.20068 13.4004 5.20068 13.4004" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M13.8005 9.8002C13.8005 10.6839 13.1737 11.4002 12.4005 11.4002C11.6273 11.4002 11.0005 10.6839 11.0005 9.8002C11.0005 8.91652 11.6273 8.2002 12.4005 8.2002C13.1737 8.2002 13.8005 8.91652 13.8005 9.8002Z" stroke="#979797" stroke-width="1.2"/>+<path d="M8.2004 9.8002C8.2004 10.6839 7.57359 11.4002 6.80039 11.4002C6.0272 11.4002 5.40039 10.6839 5.40039 9.8002C5.40039 8.91652 6.0272 8.2002 6.80039 8.2002C7.57359 8.2002 8.2004 8.91652 8.2004 9.8002Z" stroke="#979797" stroke-width="1.2"/>+</svg>diff --git a/web/apps/social/public/images/github.svg b/web/apps/social/public/images/github.svgnew file mode 100644index 0000000000..ac58c0836c--- /dev/null+++ b/web/apps/social/public/images/github.svg@@ -0,0 +1,4 @@+<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M7.08317 14.569C4.6546 15.3887 2.63079 14.569 1.4165 12.042" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M7.08317 15.5837V13.2872C7.08317 12.8634 7.21343 12.495 7.42345 12.1623C7.56753 11.934 7.46886 11.6102 7.20862 11.5386C5.05304 10.9461 3.5415 9.99328 3.5415 6.83295C3.5415 6.01132 3.81071 5.23885 4.28392 4.56652C4.40168 4.3992 4.46056 4.31555 4.47472 4.23977C4.48887 4.164 4.46426 4.06511 4.41503 3.86734C4.21469 3.06239 4.22767 2.20763 4.52837 1.43699C4.52837 1.43699 5.14972 1.23454 6.56395 2.11802C6.88684 2.31974 7.04829 2.4206 7.19048 2.44316C7.33265 2.46572 7.52276 2.41846 7.90292 2.32395C8.42284 2.19471 8.95855 2.12532 9.56234 2.12532C10.1661 2.12532 10.7018 2.19471 11.2218 2.32395C11.6019 2.41846 11.792 2.46572 11.9342 2.44316C12.0764 2.4206 12.2379 2.31974 12.5607 2.11802C13.975 1.23454 14.5963 1.43699 14.5963 1.43699C14.897 2.20763 14.91 3.06239 14.7097 3.86734C14.6604 4.06511 14.6358 4.164 14.6499 4.23977C14.6641 4.31554 14.723 4.39921 14.8408 4.56652C15.3139 5.23885 15.5832 6.01132 15.5832 6.83295C15.5832 9.99328 14.0717 10.9461 11.9161 11.5386C11.6558 11.6102 11.5571 11.934 11.7012 12.1623C11.9112 12.495 12.0415 12.8634 12.0415 13.2872V15.5837" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/web/apps/social/public/images/mastodon.svg b/web/apps/social/public/images/mastodon.svgnew file mode 100644index 0000000000..5339c8f2e1--- /dev/null+++ b/web/apps/social/public/images/mastodon.svg@@ -0,0 +1,4 @@+<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M12.0418 9.56217V5.66634C12.0418 4.68834 11.249 3.89551 10.271 3.89551C9.293 3.89551 8.50016 4.68834 8.50016 5.66634M8.50016 5.66634V8.14551M8.50016 5.66634C8.50016 4.68834 7.70733 3.89551 6.72933 3.89551C5.75133 3.89551 4.9585 4.68834 4.9585 5.66634V9.56217" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M9.20833 12.0387C10.632 12.0387 11.9637 11.8207 13.1006 11.4417C14.257 11.0561 14.875 9.88243 14.875 8.66338V5.32946C14.875 3.78838 14.046 2.32217 12.5574 1.92345C11.3517 1.60049 9.96937 1.41699 8.5 1.41699C7.03063 1.41699 5.64835 1.60049 4.44259 1.92345C2.95398 2.32217 2.125 3.78839 2.125 5.32946V10.2684C2.125 15.9334 7.79167 15.5793 7.79167 15.5793C9.5625 15.5793 10.625 14.8753 10.625 14.8753V14.167C10.625 14.167 9.5625 14.5171 7.79167 14.5171C4.0234 14.5171 5.00091 11.3306 5.00091 11.3306C6.20345 11.7778 7.65085 12.0387 9.20833 12.0387Z" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/web/apps/social/public/images/new-twitter.svg b/web/apps/social/public/images/new-twitter.svgnew file mode 100644index 0000000000..bddd7b7f66--- /dev/null+++ b/web/apps/social/public/images/new-twitter.svg@@ -0,0 +1,3 @@+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M2 14L7.03227 8.96773M8.96773 7.03227L14 14H10.6667L7.03227 8.96773L2 2H5.33333L8.96773 7.03227ZM14 2L8.96773 7.03227" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/web/apps/social/public/images/reddit.svg b/web/apps/social/public/images/reddit.svgnew file mode 100644index 0000000000..6181244d73--- /dev/null+++ b/web/apps/social/public/images/reddit.svg@@ -0,0 +1,10 @@+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M9.5999 17.6002C13.5764 17.6002 16.7999 15.2721 16.7999 12.4002C16.7999 9.52831 13.5764 7.2002 9.5999 7.2002C5.62345 7.2002 2.3999 9.52831 2.3999 12.4002C2.3999 15.2721 5.62345 17.6002 9.5999 17.6002Z" stroke="#979797" stroke-width="1.2"/>+<path d="M12.3998 13.4238C11.6117 14.038 10.6448 14.3997 9.5998 14.3997C8.55484 14.3997 7.5879 14.038 6.7998 13.4238" stroke="#979797" stroke-width="1.2" stroke-linecap="round"/>+<path d="M15.2001 4.79961C16.0838 4.79961 16.8001 4.08327 16.8001 3.19961C16.8001 2.31595 16.0838 1.59961 15.2001 1.59961C14.3164 1.59961 13.6001 2.31595 13.6001 3.19961C13.6001 4.08327 14.3164 4.79961 15.2001 4.79961Z" stroke="#979797" stroke-width="1.2"/>+<path d="M14.3999 8.05572C14.6949 7.54462 15.2506 7.2002 15.8875 7.2002C16.8333 7.2002 17.5999 7.95956 17.5999 8.89628C17.5999 9.5498 17.2268 10.1169 16.6801 10.4002" stroke="#979797" stroke-width="1.2" stroke-linecap="round"/>+<path d="M4.8001 8.05572C4.5051 7.54462 3.9494 7.2002 3.31248 7.2002C2.36676 7.2002 1.6001 7.95956 1.6001 8.89628C1.6001 9.5498 1.97322 10.1169 2.51995 10.4002" stroke="#979797" stroke-width="1.2" stroke-linecap="round"/>+<path d="M13.6001 3.2002C11.7145 3.2002 10.7717 3.2002 10.1859 3.78598C9.6001 4.37177 9.6001 5.31458 9.6001 7.2002" stroke="#979797" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M7.20697 10.4004H7.19922" stroke="#979797" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M12.0068 10.4004H11.999" stroke="#979797" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+</svg>diff --git a/web/apps/social/public/images/youtube.svg b/web/apps/social/public/images/youtube.svgnew file mode 100644index 0000000000..0e03fca447--- /dev/null+++ b/web/apps/social/public/images/youtube.svg@@ -0,0 +1,4 @@+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M9.6001 16.3998C11.0479 16.3998 12.4362 16.2568 13.7228 15.9945C15.3299 15.6669 16.1335 15.5031 16.8668 14.5603C17.6001 13.6175 17.6001 12.5352 17.6001 10.3706V8.829C17.6001 6.66439 17.6001 5.5821 16.8668 4.6393C16.1335 3.69651 15.3299 3.53271 13.7228 3.2051C12.4362 2.94282 11.0479 2.7998 9.6001 2.7998C8.15234 2.7998 6.76401 2.94282 5.47735 3.2051C3.87023 3.53271 3.06667 3.69651 2.33338 4.6393C1.6001 5.5821 1.6001 6.66439 1.6001 8.829V10.3706C1.6001 12.5352 1.6001 13.6175 2.33338 14.5603C3.06667 15.5031 3.87023 15.6669 5.47735 15.9945C6.76401 16.2568 8.15234 16.3998 9.6001 16.3998Z" stroke="#979797" stroke-width="1.2"/>+<path d="M12.7699 9.85012C12.6512 10.3348 12.0195 10.6828 10.7561 11.3791C9.38195 12.1362 8.69492 12.5148 8.13844 12.369C7.94996 12.3196 7.77636 12.2327 7.63059 12.1148C7.2002 11.7669 7.2002 11.0445 7.2002 9.5998C7.2002 8.15508 7.2002 7.4327 7.63059 7.08475C7.77636 6.96689 7.94996 6.88004 8.13844 6.83064C8.69492 6.68477 9.38195 7.06336 10.7561 7.82055C12.0195 8.51676 12.6512 8.86484 12.7699 9.34948C12.8103 9.51444 12.8103 9.68516 12.7699 9.85012Z" stroke="#979797" stroke-width="1.2" stroke-linejoin="round"/>+</svg>diff --git a/web/apps/social/src/pages/index.tsx b/web/apps/social/src/pages/index.tsxindex 2177e82e16..e5b4521b7b 100644--- a/web/apps/social/src/pages/index.tsx+++ b/web/apps/social/src/pages/index.tsx@@ -14,6 +14,7 @@ import {} from "screens/OnboardingScreen";import { ProfileScreen, profileBackground } from "screens/ProfileScreen";import { PublicProfileScreen } from "screens/PublicProfileScreen";+import { SettingsScreen, settingsBackground } from "screens/SettingsScreen";import {SetupProfileScreen,setupProfileBackground,@@ -36,7 +37,8 @@ type Screen =| "setup-profile"| "share-profile-link"| "home"- | "profile";+ | "profile"+ | "settings";type ProfileBackScreen = "login" | "verify-email";@@ -114,7 +116,9 @@ const Page: React.FC = () => {? homeBackground: screen == "profile"? profileBackground- : createAccountBackground;+ : screen == "settings"+ ? settingsBackground+ : createAccountBackground;return (<>@@ -195,6 +199,14 @@ const Page: React.FC = () => {<ProfileScreenprofile={profile}onBack={() => setScreen("home")}+ onOpenSettings={() => setScreen("settings")}+ />+ )}+ {screen == "settings" && profile && (+ <SettingsScreen+ email={email}+ profile={profile}+ onBack={() => setScreen("profile")}/>)}</>diff --git a/web/apps/social/src/screens/ProfileScreen.tsx b/web/apps/social/src/screens/ProfileScreen.tsxindex c6866739ae..e13514a315 100644--- a/web/apps/social/src/screens/ProfileScreen.tsx+++ b/web/apps/social/src/screens/ProfileScreen.tsx@@ -1,9 +1,15 @@-import ArrowBackRoundedIcon from "@mui/icons-material/ArrowBackRounded";-import SettingsRoundedIcon from "@mui/icons-material/SettingsRounded";-import { Box } from "@mui/material";+import {+ ArrowLeft02Icon,+ MoreHorizontalIcon,+ Settings01Icon,+} from "@hugeicons/core-free-icons";+import { HugeiconsIcon } from "@hugeicons/react";+import { Box, Menu, MenuItem } from "@mui/material";import { EnteLogo } from "ente-base/components/EnteLogo";-import React from "react";+import React, { useState } from "react";import type { SetupProfile } from "screens/SetupProfileScreen";+import { LinkIcon, ShareIcon } from "screens/ShareProfileLinkScreen";+import { profileLinkForUsername } from "utils/profileLink";export const profileBackground = "#FFFFFF";@@ -132,16 +138,21 @@ const buildPostMasonryRows = (items: SamplePostItem[]): PostMasonryRow[] => {interface ProfileScreenProps {headerVariant?: "owner" | "public";onBack?: () => void;+ onOpenSettings?: () => void;profile: SetupProfile;}export const ProfileScreen: React.FC<ProfileScreenProps> = ({headerVariant = "owner",onBack,+ onOpenSettings,profile,}) => {+ const [profileActionsAnchor, setProfileActionsAnchor] =+ useState<HTMLElement | null>(null);const isPublicProfile = headerVariant == "public";const displayName = profile.fullName.trim() || profile.username.trim();+ const profileLink = profileLinkForUsername(profile.username.trim());const initialsSource = displayName || profile.username.trim();const initials = initialsSource.split(/\s+/)@@ -153,6 +164,30 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({0,);const friendsCount = 7;+ const isProfileActionsOpen = Boolean(profileActionsAnchor);++ const closeProfileActions = () => setProfileActionsAnchor(null);++ const copyProfileURL = async () => {+ closeProfileActions();+ await navigator.clipboard.writeText(profileLink);+ };++ const shareProfile = async () => {+ closeProfileActions();++ if (typeof navigator.share == "function") {+ try {+ await navigator.share({ url: profileLink });+ return;+ } catch (error) {+ if (error instanceof DOMException && error.name == "AbortError")+ return;+ }+ }++ await navigator.clipboard.writeText(profileLink);+ };return (<Box@@ -246,7 +281,11 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({},}}>- <ArrowBackRoundedIcon sx={{ fontSize: 24 }} />+ <HugeiconsIcon+ icon={ArrowLeft02Icon}+ size={24}+ strokeWidth={1.8}+ /></Box>)}{isPublicProfile && (@@ -311,12 +350,13 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({component="button"type="button"aria-label="Settings"+ onClick={onOpenSettings}sx={{alignItems: "center",bgcolor: "transparent",border: 0,color: "inherit",- cursor: "pointer",+ cursor: onOpenSettings ? "pointer" : "default",display: "flex",height: 24,justifyContent: "flex-end",@@ -329,7 +369,11 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({},}}>- <SettingsRoundedIcon sx={{ fontSize: 22 }} />+ <HugeiconsIcon+ icon={Settings01Icon}+ size={20}+ strokeWidth={1.8}+ /></Box>)}</Box>@@ -402,20 +446,219 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({><Boxsx={{- color: textStrong,- fontFamily:- '"Nunito", "Inter Variable", sans-serif',- fontSize: 26,- fontWeight: 800,- lineHeight: "32px",- maxWidth: "100%",- overflow: "hidden",- textOverflow: "ellipsis",- whiteSpace: "nowrap",+ alignItems: "center",+ display: "grid",+ gridTemplateColumns:+ "minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr)",+ minWidth: 0,+ width: "100%",}}>- {displayName}+ <Box+ sx={{+ color: textStrong,+ fontFamily:+ '"Nunito", "Inter Variable", sans-serif',+ fontSize: 26,+ fontWeight: 800,+ gridColumn: 2,+ lineHeight: "32px",+ maxWidth: isPublicProfile+ ? "100%"+ : "calc(100vw - 72px)",+ "@media (min-width: 600px)": {+ maxWidth: isPublicProfile+ ? "100%"+ : 303,+ },+ overflow: "hidden",+ textOverflow: "ellipsis",+ whiteSpace: "nowrap",+ }}+ >+ {displayName}+ </Box>+ {!isPublicProfile && (+ <Box+ component="button"+ id="profile-actions-button"+ type="button"+ aria-label="Profile actions"+ aria-controls={+ isProfileActionsOpen+ ? "profile-actions-menu"+ : undefined+ }+ aria-expanded={+ isProfileActionsOpen+ ? "true"+ : undefined+ }+ aria-haspopup="menu"+ onClick={(event) =>+ setProfileActionsAnchor(+ event.currentTarget,+ )+ }+ sx={{+ alignItems: "center",+ bgcolor: "transparent",+ border: 0,+ color: textStrong,+ cursor: "pointer",+ display: "flex",+ gridColumn: 3,+ height: 24,+ justifyContent: "center",+ justifySelf: "start",+ ml: "4px",+ p: 0,+ width: 24,+ "&:focus-visible": {+ borderRadius: "50%",+ outline: `2px solid ${green}`,+ outlineOffset: 2,+ },+ }}+ >+ <HugeiconsIcon+ icon={MoreHorizontalIcon}+ size={20}+ strokeWidth={2}+ />+ </Box>+ )}</Box>+ {!isPublicProfile && (+ <Menu+ id="profile-actions-menu"+ anchorEl={profileActionsAnchor}+ open={isProfileActionsOpen}+ onClose={closeProfileActions}+ anchorOrigin={{+ horizontal: "center",+ vertical: "bottom",+ }}+ transformOrigin={{+ horizontal: "center",+ vertical: "top",+ }}+ slotProps={{+ paper: {+ sx: {+ borderRadius: "16px",+ boxShadow:+ "0 14px 40px rgba(0, 0, 0, 0.16)",+ mt: "6px",+ minWidth: 190,+ p: "4px",+ },+ },+ list: {+ "aria-labelledby":+ "profile-actions-button",+ sx: { p: 0 },+ },+ }}+ >+ <MenuItem+ disableRipple+ onClick={() => void copyProfileURL()}+ sx={{+ borderRadius: "10px",+ gap: "8px",+ minHeight: 38,+ px: "8px",+ py: "7px",+ "&.Mui-focusVisible": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&.Mui-selected": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&.Mui-selected:hover": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&:active": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&:hover": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ }}+ >+ <Box+ sx={{+ alignItems: "center",+ color: textBase,+ display: "flex",+ flexShrink: 0,+ }}+ >+ <LinkIcon />+ </Box>+ <Box+ sx={{+ fontFamily:+ '"Inter Variable", Inter, sans-serif',+ fontSize: 13,+ fontWeight: 600,+ lineHeight: "18px",+ }}+ >+ Copy profile URL+ </Box>+ </MenuItem>+ <MenuItem+ disableRipple+ onClick={() => void shareProfile()}+ sx={{+ borderRadius: "10px",+ gap: "8px",+ minHeight: 38,+ px: "8px",+ py: "7px",+ "&.Mui-focusVisible": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&.Mui-selected": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&.Mui-selected:hover": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&:active": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ "&:hover": {+ bgcolor: "rgba(0, 0, 0, 0.025)",+ },+ }}+ >+ <Box+ sx={{+ alignItems: "center",+ color: textBase,+ display: "flex",+ flexShrink: 0,+ }}+ >+ <ShareIcon />+ </Box>+ <Box+ sx={{+ fontFamily:+ '"Inter Variable", Inter, sans-serif',+ fontSize: 13,+ fontWeight: 600,+ lineHeight: "18px",+ }}+ >+ Share profile+ </Box>+ </MenuItem>+ </Menu>+ )}<Boxsx={{color: textSoft,@@ -508,34 +751,38 @@ export const ProfileScreen: React.FC<ProfileScreenProps> = ({},}}>- {row.items.map(({ item, index }) => (- <Box- key={`${group.label}-${item.imageUrl}-${index}`}- sx={{- bgcolor: paleGreen,- display: "block",- flex: `${item.aspectRatio} 1 0`,- minWidth: 0,- overflow: "hidden",- }}- >+ {row.items.map(+ ({ item, index }) => (<Box- component="img"- alt={`${group.label} post ${- index + 1- }`}- src={item.imageUrl}+ key={`${group.label}-${item.imageUrl}-${index}`}sx={{+ bgcolor: paleGreen,display: "block",- height: "100%",- objectFit: "cover",- objectPosition:- "center",- width: "100%",+ flex: `${item.aspectRatio} 1 0`,+ minWidth: 0,+ overflow: "hidden",}}- />- </Box>- ))}+ >+ <Box+ component="img"+ alt={`${group.label} post ${+ index + 1+ }`}+ src={item.imageUrl}+ sx={{+ display:+ "block",+ height: "100%",+ objectFit:+ "cover",+ objectPosition:+ "center",+ width: "100%",+ }}+ />+ </Box>+ ),+ )}</Box>),)}diff --git a/web/apps/social/src/screens/SettingsScreen.tsx b/web/apps/social/src/screens/SettingsScreen.tsxnew file mode 100644index 0000000000..e9a9d1bed2--- /dev/null+++ b/web/apps/social/src/screens/SettingsScreen.tsx@@ -0,0 +1,288 @@+import {+ ArrowLeft02Icon,+ ArrowRight01Icon as ChevronRightIcon,+ CustomerSupportIcon,+ HelpCircleIcon,+ Logout05Icon,+} from "@hugeicons/core-free-icons";+import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";+import { Box } from "@mui/material";+import React from "react";+import type { SetupProfile } from "screens/SetupProfileScreen";++export const settingsBackground = "#FAFAFA";++const green = "#08C225";+const textBase = "#000";+const textMuted = "rgba(0, 0, 0, 0.6)";+const rowBackground = "#FFFFFF";+const dangerColor = "#F63A3A";+const iconMuted = "#8C8C8C";++interface SettingsScreenProps {+ email: string;+ onBack?: () => void;+ profile: SetupProfile;+}++interface SettingsRowProps {+ danger?: boolean;+ icon: IconSvgElement;+ label: string;+}++interface SocialIconProps {+ label: string;+ src: string;+}++const SettingsRow: React.FC<SettingsRowProps> = ({ danger, icon, label }) => (+ <Box+ component="button"+ type="button"+ sx={{+ alignItems: "center",+ bgcolor: rowBackground,+ border: 0,+ borderRadius: "20px",+ cursor: "pointer",+ display: "flex",+ justifyContent: "space-between",+ minHeight: 56,+ p: "8px",+ textAlign: "left",+ transition: "background-color 120ms ease",+ width: "100%",+ "&:active": { bgcolor: "rgba(0, 0, 0, 0.025)" },+ "&:focus-visible": {+ outline: `2px solid ${green}`,+ outlineOffset: 2,+ },+ "&:hover": { bgcolor: "rgba(0, 0, 0, 0.025)" },+ }}+ >+ <Box+ sx={{+ alignItems: "center",+ display: "flex",+ gap: "8px",+ minWidth: 0,+ }}+ >+ <Box+ sx={{+ alignItems: "center",+ borderRadius: "12px",+ color: danger ? dangerColor : iconMuted,+ display: "flex",+ flexShrink: 0,+ height: 40,+ justifyContent: "center",+ width: 40,+ }}+ >+ <HugeiconsIcon icon={icon} size={24} strokeWidth={1.6} />+ </Box>+ <Box+ sx={{+ color: danger ? dangerColor : textBase,+ fontFamily: '"Inter Variable", Inter, sans-serif',+ fontSize: 14,+ fontWeight: 600,+ lineHeight: "17px",+ minWidth: 0,+ overflow: "hidden",+ textOverflow: "ellipsis",+ whiteSpace: "nowrap",+ }}+ >+ {label}+ </Box>+ </Box>+ <HugeiconsIcon+ aria-hidden+ icon={ChevronRightIcon}+ size={20}+ strokeWidth={1.8}+ style={{ color: textBase, flexShrink: 0 }}+ />+ </Box>+);++const SocialIcon: React.FC<SocialIconProps> = ({ label, src }) => (+ <Box+ aria-label={label}+ component="button"+ type="button"+ sx={{+ alignItems: "center",+ bgcolor: "transparent",+ border: 0,+ borderRadius: "10px",+ cursor: "pointer",+ display: "flex",+ height: 32,+ justifyContent: "center",+ p: 0,+ transition: "background-color 120ms ease",+ width: 32,+ "&:active": { bgcolor: "rgba(0, 0, 0, 0.025)" },+ "&:focus-visible": {+ outline: `2px solid ${green}`,+ outlineOffset: 2,+ },+ "&:hover": { bgcolor: "rgba(0, 0, 0, 0.025)" },+ }}+ >+ <Box+ component="img"+ aria-hidden+ alt=""+ src={src}+ sx={{ display: "block", maxHeight: 20, maxWidth: 20 }}+ />+ </Box>+);++export const SettingsScreen: React.FC<SettingsScreenProps> = ({+ email,+ onBack,+ profile,+}) => {+ const accountLabel = email.trim() || `${profile.username}@ente.io`;++ return (+ <Box+ component="main"+ sx={{+ bgcolor: settingsBackground,+ color: textBase,+ display: "grid",+ minHeight: "100svh",+ overflowX: "hidden",+ placeItems: { xs: "stretch", sm: "start center" },+ }}+ >+ <Box+ sx={{+ bgcolor: settingsBackground,+ boxSizing: "border-box",+ display: "flex",+ flexDirection: "column",+ minHeight: "100svh",+ mx: "auto",+ width: "100%",+ "@media (min-width: 600px)": { maxWidth: 375 },+ }}+ >+ <Box+ component="header"+ sx={{+ alignItems: "center",+ display: "grid",+ gridTemplateColumns: "24px 1fr 24px",+ height: 56,+ px: 2,+ width: "100%",+ }}+ >+ <Box+ component="button"+ type="button"+ aria-label="Back to profile"+ onClick={onBack}+ sx={{+ alignItems: "center",+ bgcolor: "transparent",+ border: 0,+ color: textBase,+ cursor: onBack ? "pointer" : "default",+ display: "flex",+ height: 24,+ justifyContent: "flex-start",+ p: 0,+ width: 24,+ "&:focus-visible": {+ borderRadius: "50%",+ outline: `2px solid ${green}`,+ outlineOffset: 2,+ },+ }}+ >+ <HugeiconsIcon+ icon={ArrowLeft02Icon}+ size={24}+ strokeWidth={1.8}+ />+ </Box>+ <Box+ component="h1"+ sx={{+ color: textBase,+ fontFamily: '"Inter Variable", Inter, sans-serif',+ fontSize: 18,+ fontWeight: 700,+ justifySelf: "center",+ lineHeight: "24px",+ m: 0,+ }}+ >+ Settings+ </Box>+ </Box>++ <Box+ sx={{+ color: textMuted,+ fontFamily: '"Inter Variable", Inter, sans-serif',+ fontSize: 16,+ fontWeight: 600,+ lineHeight: "20px",+ mt: "29px",+ overflow: "hidden",+ px: "22px",+ textOverflow: "ellipsis",+ whiteSpace: "nowrap",+ }}+ >+ {accountLabel}+ </Box>++ <Box+ component="section"+ sx={{+ display: "flex",+ flexDirection: "column",+ gap: "8px",+ mt: "16px",+ px: "14px",+ width: "100%",+ }}+ >+ <SettingsRow icon={HelpCircleIcon} label="Help" />+ <SettingsRow icon={CustomerSupportIcon} label="Support" />+ <SettingsRow danger icon={Logout05Icon} label="Logout" />+ </Box>++ <Box sx={{ flex: 1, minHeight: 72 }} />++ <Box+ sx={{+ alignItems: "center",+ display: "flex",+ gap: "8px",+ justifyContent: "center",+ pb: "18px",+ }}+ >+ <SocialIcon label="Discord" src="/images/discord.svg" />+ <SocialIcon label="YouTube" src="/images/youtube.svg" />+ <SocialIcon label="GitHub" src="/images/github.svg" />+ <SocialIcon label="X" src="/images/new-twitter.svg" />+ <SocialIcon label="Mastodon" src="/images/mastodon.svg" />+ <SocialIcon label="Reddit" src="/images/reddit.svg" />+ </Box>+ </Box>+ </Box>+ );+};diff --git a/web/apps/social/src/screens/ShareProfileLinkScreen.tsx b/web/apps/social/src/screens/ShareProfileLinkScreen.tsxindex 349d7c1615..5e3b3ac87e 100644--- a/web/apps/social/src/screens/ShareProfileLinkScreen.tsx+++ b/web/apps/social/src/screens/ShareProfileLinkScreen.tsx@@ -1,6 +1,7 @@import { Box } from "@mui/material";import React, { useState } from "react";import type { SetupProfile } from "screens/SetupProfileScreen";+import { profileLinkForUsername } from "utils/profileLink";export const shareProfileLinkBackground = "#FAFAFA";@@ -10,7 +11,6 @@ const textMuted = "#666";const textLight = "#969696";const paleGreen = "#E7F6E9";const iconFill = "#F0F0F0";-const profileSecret = "5d2a9WhmD2NU";interface ShareProfileLinkScreenProps {onBack: () => void;@@ -25,9 +25,6 @@ interface ActionRowProps {status?: string;}-const profileLinkForUsername = (username: string) =>- `https://ente.gg/${encodeURIComponent(username || "anandbaburajan")}#${profileSecret}`;-const BackIcon: React.FC = () => (<Boxcomponent="svg"@@ -46,7 +43,7 @@ const BackIcon: React.FC = () => (</Box>);-const ShareIcon: React.FC = () => (+export const ShareIcon: React.FC = () => (<Boxcomponent="svg"viewBox="0 0 24 24"@@ -64,7 +61,7 @@ const ShareIcon: React.FC = () => (</Box>);-const LinkIcon: React.FC = () => (+export const LinkIcon: React.FC = () => (<Boxcomponent="svg"viewBox="0 0 24 24"@@ -199,9 +196,7 @@ export const ShareProfileLinkScreen: React.FC<ShareProfileLinkScreenProps> = ({};const shareProfileLink = async () => {- const shareData = {- url: profileLink,- };+ const shareData = { url: profileLink };if (typeof navigator.share == "function") {try {diff --git a/web/apps/social/src/utils/profileLink.ts b/web/apps/social/src/utils/profileLink.tsnew file mode 100644index 0000000000..214f995c65--- /dev/null+++ b/web/apps/social/src/utils/profileLink.ts@@ -0,0 +1,4 @@+const profileSecret = "5d2a9WhmD2NU";++export const profileLinkForUsername = (username: string) =>+ `https://ente.gg/${encodeURIComponent(username || "anandbaburajan")}#${profileSecret}`;