Skip to content

armgit / ente

Public Imported from GitHub
0

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

Refine Space dark mode controls and toasts

Anand Baburajan50d656fb0542
diff --git a/web/apps/space/src/components/ActionToast.tsx b/web/apps/space/src/components/ActionToast.tsx
index d83b4a8ae8..6746661913 100644
--- a/web/apps/space/src/components/ActionToast.tsx
+++ b/web/apps/space/src/components/ActionToast.tsx
@@ -152,7 +152,7 @@ export const SpaceActionToast: React.FC<SpaceActionToastProps> = ({
p: 0,
width: 36,
"&:focus-visible": {
- outline: "2px solid rgba(0 0 0 / 0.72)",
+ outline: `2px solid ${spaceText}`,
outlineOffset: 2,
},
}}
diff --git a/web/apps/space/src/components/FileViewer.tsx b/web/apps/space/src/components/FileViewer.tsx
index c7058e66bc..bd97ac5e11 100644
--- a/web/apps/space/src/components/FileViewer.tsx
+++ b/web/apps/space/src/components/FileViewer.tsx
@@ -27,6 +27,7 @@ import log from "ente-base/log";
import type PhotoSwipe from "photoswipe";
import React from "react";
import type { SpaceInviteIntent } from "services/invite";
+import { spaceDialogBackground, spaceTextMuted } from "styles/colors";
import { spaceTouchTargetSize } from "styles/touch-targets";
import { firstNameFrom, formatSpaceDate } from "utils/display";
import { clampSpaceMessageText } from "utils/message-limits";
@@ -1812,7 +1813,6 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
}}
/>
<Box
- className="green-bg"
component="button"
type="button"
aria-label={
@@ -1827,12 +1827,12 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
onPointerDown={handleInputActionPointerDown}
sx={{
alignItems: "center",
- bgcolor: green,
+ bgcolor: "#FFFFFF",
border: 0,
borderRadius: "24px",
boxSizing: "border-box",
boxShadow: "0 10px 28px rgba(0, 0, 0, 0.28)",
- color: "#FFFFFF",
+ color: "#1C1C1E",
cursor: isDraftPostPublishDisabled
? "default"
: "pointer",
@@ -1966,12 +1966,12 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
onClick={updateCaption}
sx={{
alignItems: "center",
- bgcolor: controlBackground,
+ bgcolor: "#FFFFFF",
border: 0,
borderRadius: "24px",
boxSizing: "border-box",
boxShadow: "0 10px 28px rgba(0, 0, 0, 0.28)",
- color: textBase,
+ color: "#1C1C1E",
cursor: isCaptionUpdateDisabled
? "default"
: "pointer",
@@ -1987,19 +1987,23 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
minWidth: 70,
px: "20px",
py: "10px",
- "&:disabled": {
- opacity: captionUpdateActionPhase
- ? 1
- : 0.62,
- },
+ transition:
+ "background-color 160ms ease, color 160ms ease, filter 120ms ease",
+ "&:disabled": isCaptionUpdateActionRunning
+ ? undefined
+ : {
+ bgcolor: spaceDialogBackground,
+ color: spaceTextMuted,
+ },
"&:focus-visible": {
outline: `2px solid ${green}`,
outlineOffset: 2,
},
- "&:hover": {
- bgcolor: isCaptionUpdateDisabled
- ? controlBackground
- : controlBackgroundHover,
+ "&:hover:not(:disabled)": {
+ filter: "brightness(0.96)",
+ },
+ "&:active:not(:disabled)": {
+ filter: "brightness(0.92)",
},
}}
>
@@ -2055,7 +2059,6 @@ export const SpaceFileViewer: React.FC<SpaceFileViewerProps> = ({
>
<HugeiconsIcon
icon={Tick02Icon}
- primaryColor={green}
size={22}
strokeWidth={1.8}
/>
diff --git a/web/apps/space/src/components/FriendQuickActionsDialog.tsx b/web/apps/space/src/components/FriendQuickActionsDialog.tsx
index f44be4a0d6..d3583ba992 100644
--- a/web/apps/space/src/components/FriendQuickActionsDialog.tsx
+++ b/web/apps/space/src/components/FriendQuickActionsDialog.tsx
@@ -10,7 +10,13 @@ import type { FriendProfile } from "data/friends";
import log from "ente-base/log";
import { useBrowserBackClose } from "hooks/use-browser-back-close";
import React from "react";
-import { spaceDialogBackground, spaceSurface, spaceText } from "styles/colors";
+import {
+ spaceAppBackgroundColor,
+ spaceDialogBackground,
+ spaceSurface,
+ spaceSurfaceHover,
+ spaceText,
+} from "styles/colors";
const actionHeight = 40;
const dialogPadding = 12;
@@ -110,12 +116,14 @@ export const FriendQuickActionsDialog: React.FC<
aria-labelledby={nameID}
maxWidth={false}
transitionDuration={prefersReducedMotion ? 0 : 220}
+ sx={{ "--space-dialog-backdrop": "rgba(0 0 0 / 0.64)" }}
slotProps={{
paper: {
ref: paperRef,
sx: {
- bgcolor: spaceDialogBackground,
- boxShadow: "none",
+ bgcolor: spaceSurface,
+ boxShadow:
+ "0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 64px rgba(0, 0, 0, 0.48)",
borderRadius: `${dialogRadius}px`,
boxSizing: "border-box",
display: "flex",
@@ -169,7 +177,7 @@ export const FriendQuickActionsDialog: React.FC<
sx={{
alignSelf: "center",
aspectRatio: "1",
- bgcolor: spaceSurface,
+ bgcolor: spaceAppBackgroundColor,
borderRadius: `${innerRadius}px`,
flexShrink: 0,
overflow: "hidden",
@@ -182,7 +190,7 @@ export const FriendQuickActionsDialog: React.FC<
aria-hidden
sx={{
background:
- "linear-gradient(rgba(0, 0, 0, 0.28), transparent 45%)",
+ "linear-gradient(rgba(0, 0, 0, 0.52), transparent 55%)",
inset: 0,
pointerEvents: "none",
position: "absolute",
@@ -256,22 +264,27 @@ export const FriendQuickActionsDialog: React.FC<
sx={{
alignItems: "center",
appearance: "none",
- bgcolor: spaceSurface,
+ bgcolor: action.active
+ ? "#24412E"
+ : spaceDialogBackground,
border: 0,
borderRadius: `${innerRadius}px`,
- color: spaceText,
+ color: action.active
+ ? "color(display-p3 0.0314 0.7608 0.1451)"
+ : spaceText,
cursor: action.disabled ? "default" : "pointer",
display: "grid",
justifyItems: "center",
height: actionHeight,
minWidth: 0,
p: "0 8px",
- transition: "filter 120ms ease",
+ transition:
+ "background-color 120ms ease, color 120ms ease",
"&:hover:not(:disabled)": {
- filter: "brightness(0.96)",
+ bgcolor: spaceSurfaceHover,
},
"&:active:not(:disabled)": {
- filter: "brightness(0.92)",
+ bgcolor: spaceAppBackgroundColor,
},
"&:focus-visible": {
outline: `2px solid ${spaceText}`,
@@ -284,7 +297,6 @@ export const FriendQuickActionsDialog: React.FC<
aria-hidden
sx={{
alignItems: "center",
- color: action.active ? "#08C225" : spaceText,
display: "flex",
height: 24,
justifyContent: "center",
diff --git a/web/apps/space/src/components/PWAInstallPrompt.tsx b/web/apps/space/src/components/PWAInstallPrompt.tsx
index 397566b486..7655d16170 100644
--- a/web/apps/space/src/components/PWAInstallPrompt.tsx
+++ b/web/apps/space/src/components/PWAInstallPrompt.tsx
@@ -17,9 +17,11 @@ import { useSpacePWAInstallPrompt } from "hooks/use-pwa-install-prompt";
import { useSpaceWebPushPrompt } from "hooks/use-web-push-prompt";
import React from "react";
import {
+ spaceAppBackgroundColor,
spaceDialogBackground,
spaceOnAccent,
spaceSurface,
+ spaceSurfaceHover,
spaceText,
spaceTextMuted,
} from "styles/colors";
@@ -278,17 +280,16 @@ export const SpacePWAPromptBanner: React.FC<SpacePWAPromptBannerProps> = ({
<Box sx={{ alignItems: "center", display: "flex", flexShrink: 0 }}>
{onAction && (
<Box
- className="green-bg"
component="button"
type="button"
disabled={actionDisabled}
onClick={onAction}
sx={{
alignItems: "center",
- bgcolor: green,
+ bgcolor: "#FFFFFF",
border: 0,
borderRadius: "14px",
- color: spaceOnAccent,
+ color: spaceAppBackgroundColor,
cursor: actionDisabled ? "default" : "pointer",
display: "flex",
fontFamily: '"Inter Variable", Inter, sans-serif',
@@ -297,8 +298,18 @@ export const SpacePWAPromptBanner: React.FC<SpacePWAPromptBannerProps> = ({
height: 34,
justifyContent: "center",
minWidth: 48,
- opacity: actionDisabled ? 0.7 : 1,
px: "17px",
+ transition:
+ "background-color 120ms ease, color 120ms ease",
+ "&:disabled": {
+ bgcolor: spaceSurfaceHover,
+ color: spaceTextMuted,
+ },
+ "&:focus-visible": {
+ outline: `2px solid ${spaceText}`,
+ outlineOffset: 2,
+ },
+ "&:hover:not(:disabled)": { bgcolor: spaceText },
}}
>
{actionLabel}
@@ -321,6 +332,10 @@ export const SpacePWAPromptBanner: React.FC<SpacePWAPromptBannerProps> = ({
justifyContent: "center",
p: 0,
width: 36,
+ "&:focus-visible": {
+ outline: `2px solid ${spaceText}`,
+ outlineOffset: 2,
+ },
}}
>
<HugeiconsIcon