Skip to content

armgit / ente

Public Imported from GitHub
0

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

refractor(memories):fixing-try-ente-btn

Aswin Asok9d72a84b6e29
diff --git a/web/apps/memories/src/components/LaneMemoryViewer.tsx b/web/apps/memories/src/components/LaneMemoryViewer.tsx
index ff37c588b8..1abed8d54f 100644
--- a/web/apps/memories/src/components/LaneMemoryViewer.tsx
+++ b/web/apps/memories/src/components/LaneMemoryViewer.tsx
@@ -805,6 +805,9 @@ export function LaneMemoryViewer({
/>
</BrandLink>
<MobileJoinNowButton
+ variant="contained"
+ color="accent"
+ disableElevation
href="https://ente.io"
target="_blank"
rel="noreferrer"
@@ -814,6 +817,9 @@ export function LaneMemoryViewer({
</ViewerFooterBar>
) : (
<JoinNowButton
+ variant="contained"
+ color="accent"
+ disableElevation
href="https://ente.io"
target="_blank"
rel="noreferrer"
diff --git a/web/apps/memories/src/components/MemoryViewer.tsx b/web/apps/memories/src/components/MemoryViewer.tsx
index ca725098cf..7116d0f838 100644
--- a/web/apps/memories/src/components/MemoryViewer.tsx
+++ b/web/apps/memories/src/components/MemoryViewer.tsx
@@ -494,11 +494,14 @@ export function MemoryViewer({
/>
</BrandLink>
<MobileJoinNowButton
+ variant="contained"
+ color="accent"
+ disableElevation
href="https://ente.io"
target="_blank"
rel="noreferrer"
>
- Try now
+ Try Ente
</MobileJoinNowButton>
</MobileTopActions>
) : (
@@ -519,11 +522,14 @@ export function MemoryViewer({
<TopRightActions>
<JoinNowButton
+ variant="contained"
+ color="accent"
+ disableElevation
href="https://ente.io"
target="_blank"
rel="noreferrer"
>
- Try now
+ Try Ente
</JoinNowButton>
</TopRightActions>
</TopControls>
diff --git a/web/apps/memories/src/components/PublicMemoryControls.tsx b/web/apps/memories/src/components/PublicMemoryControls.tsx
index f645138f49..040472f4ca 100644
--- a/web/apps/memories/src/components/PublicMemoryControls.tsx
+++ b/web/apps/memories/src/components/PublicMemoryControls.tsx
@@ -13,6 +13,8 @@ const MOBILE_LAYOUT_BREAKPOINT_PX = 600;
const DESKTOP_PROGRESS_MAX_WIDTH_PX = 448;
const MOBILE_PROGRESS_MAX_WIDTH_PX = 326;
const MINIMAL_DESKTOP_PROGRESS_MAX_WIDTH_PX = 392;
+const MINIMAL_PROGRESS_COMPACT_BREAKPOINT_PX = 700;
+const MINIMAL_PROGRESS_COMPACT_MAX_WIDTH_PX = 352;
const progressFillAnimation = keyframes`
from { width: 0%; }
@@ -334,6 +336,7 @@ export const ProgressIndicator: React.FC<ProgressIndicatorProps> = ({
);
const progressGap = total > 15 ? "4px" : minimal ? "8px" : "12px";
const progressHeight = minimal ? "2px" : "4px";
+ const compactMinimalProgressGap = total > 15 ? "3px" : "6px";
const progressTrackOpacity = minimal ? 0.24 : 0.45;
const progressFillColor = minimal ? "rgba(255, 255, 255, 0.78)" : "white";
@@ -351,6 +354,14 @@ export const ProgressIndicator: React.FC<ProgressIndicatorProps> = ({
: `${DESKTOP_PROGRESS_MAX_WIDTH_PX}px`,
minWidth: 0,
height: progressHeight,
+ ...(minimal && {
+ [`@media (max-width: ${MINIMAL_PROGRESS_COMPACT_BREAKPOINT_PX}px)`]:
+ {
+ gap: compactMinimalProgressGap,
+ maxWidth: `${MINIMAL_PROGRESS_COMPACT_MAX_WIDTH_PX}px`,
+ height: "1.5px",
+ },
+ }),
}}
>
{segments.map((i) => (
@@ -370,6 +381,7 @@ export const ProgressIndicator: React.FC<ProgressIndicatorProps> = ({
paused={paused}
duration={duration}
height={progressHeight}
+ minimal={minimal}
trackOpacity={progressTrackOpacity}
fillColor={progressFillColor}
onComplete={
@@ -386,6 +398,7 @@ interface ProgressBarProps {
paused: boolean;
duration: number;
height: string;
+ minimal?: boolean;
trackOpacity: number;
fillColor: string;
onComplete?: () => void;
@@ -400,6 +413,7 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
paused,
duration,
height,
+ minimal,
trackOpacity,
fillColor,
onComplete,
@@ -414,6 +428,12 @@ const ProgressBar: React.FC<ProgressBarProps> = ({
borderRadius: "999px",
backgroundColor: `rgba(255, 255, 255, ${trackOpacity})`,
overflow: "hidden",
+ ...(minimal && {
+ [`@media (max-width: ${MINIMAL_PROGRESS_COMPACT_BREAKPOINT_PX}px)`]:
+ {
+ height: "1.5px",
+ },
+ }),
}}
>
<Box
diff --git a/web/apps/memories/src/components/PublicMemoryViewerShared.ts b/web/apps/memories/src/components/PublicMemoryViewerShared.ts
index 2b15a70e81..828bcd1ae5 100644
--- a/web/apps/memories/src/components/PublicMemoryViewerShared.ts
+++ b/web/apps/memories/src/components/PublicMemoryViewerShared.ts
@@ -4,7 +4,7 @@
* `LaneMemoryViewer`, and is also imported by `pages/index.tsx` for viewer prop
* types.
*/
-import { styled } from "@mui/material";
+import { Button, styled } from "@mui/material";
import type { EnteFile } from "ente-media/file";
import type {
PublicMemoryShareFrame,
@@ -87,34 +87,27 @@ export const EnteBrandTagImage = styled("img")({
userSelect: "none",
});
-// Desktop-sized CTA used by both `MemoryViewer` and `LaneMemoryViewer`.
-export const JoinNowButton = styled("a")({
- backgroundColor: "#08c225",
- color: "white",
- textDecoration: "none",
- borderRadius: "39px",
- padding: "18px 32px",
- fontWeight: 700,
- fontSize: "16px",
- lineHeight: "14px",
- whiteSpace: "nowrap",
- transition: "filter 150ms ease",
- "&:hover": { filter: "brightness(1.08)" },
- "@media (max-width: 900px)": { padding: "14px 24px", fontSize: "14px" },
+const joinNowButtonStyles = {
+ backgroundColor: "#08C225",
+ borderRadius: "16px",
+ paddingBlock: "11px",
+ paddingInline: "20px",
+ "&:hover": { backgroundColor: "#07A820" },
+};
+
+const JoinNowButtonRoot = styled(Button)({
+ ...joinNowButtonStyles,
+ fontSize: "17px",
+ paddingBlock: "14px",
+ paddingInline: "30px",
});
+const MobileJoinNowButtonRoot = styled(Button)(joinNowButtonStyles);
+
+// Desktop-sized CTA used by both `MemoryViewer` and `LaneMemoryViewer`.
+export const JoinNowButton = JoinNowButtonRoot as typeof Button;
// Mobile CTA used by both viewer variants when actions collapse into the footer.
-export const MobileJoinNowButton = styled("a")({
- backgroundColor: "#08c225",
- color: "white",
- textDecoration: "none",
- borderRadius: "33px",
- padding: "16px 28px",
- fontWeight: 700,
- fontSize: "14px",
- lineHeight: "12px",
- whiteSpace: "nowrap",
-});
+export const MobileJoinNowButton = MobileJoinNowButtonRoot as typeof Button;
// Shared mobile footer action row used by both viewers.
export const ViewerFooterBar = styled("div")({