Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix Trip join album CTA

Anand Baburajan3b894dee535c
diff --git a/web/apps/albums/src/public-album/components/TripLayout/MobileNavBar.tsx b/web/apps/albums/src/public-album/components/TripLayout/MobileNavBar.tsx
index 8d61f160c2..d8999007a5 100644
--- a/web/apps/albums/src/public-album/components/TripLayout/MobileNavBar.tsx
+++ b/web/apps/albums/src/public-album/components/TripLayout/MobileNavBar.tsx
@@ -18,6 +18,8 @@ interface MobileNavBarProps {
enableDownload?: boolean;
onShowFeed?: () => void;
collectionTitle?: string;
+ enableJoin?: boolean;
+ onJoinAlbum?: () => void;
}
export const MobileNavBar: React.FC<MobileNavBarProps> = ({
@@ -26,6 +28,8 @@ export const MobileNavBar: React.FC<MobileNavBarProps> = ({
enableDownload,
onShowFeed,
collectionTitle,
+ enableJoin,
+ onJoinAlbum,
}) => {
const iconStrokeWidth = 1.8;
const [showCopiedMessage, setShowCopiedMessage] = useState(false);
@@ -89,10 +93,14 @@ export const MobileNavBar: React.FC<MobileNavBarProps> = ({
<MobileSignUpButton
onClick={() => {
- window.location.href = getEnteURL();
+ if (enableJoin) {
+ onJoinAlbum?.();
+ } else {
+ window.location.href = getEnteURL();
+ }
}}
>
- {t("get_ente_photos")}
+ {enableJoin ? t("join_album") : t("get_ente_photos")}
</MobileSignUpButton>
</ButtonGroup>
</MobileNavContainer>
diff --git a/web/apps/albums/src/public-album/components/TripLayout/TopNavButtons.tsx b/web/apps/albums/src/public-album/components/TripLayout/TopNavButtons.tsx
index 81d39395b3..5441c83923 100644
--- a/web/apps/albums/src/public-album/components/TripLayout/TopNavButtons.tsx
+++ b/web/apps/albums/src/public-album/components/TripLayout/TopNavButtons.tsx
@@ -16,6 +16,8 @@ interface TopNavButtonsProps {
downloadAllFiles: () => void;
enableDownload?: boolean;
onShowFeed?: () => void;
+ enableJoin?: boolean;
+ onJoinAlbum?: () => void;
}
export const TopNavButtons: React.FC<TopNavButtonsProps> = ({
@@ -23,6 +25,8 @@ export const TopNavButtons: React.FC<TopNavButtonsProps> = ({
downloadAllFiles,
enableDownload,
onShowFeed,
+ enableJoin,
+ onJoinAlbum,
}) => {
const iconStrokeWidth = 1.8;
const [showCopiedMessage, setShowCopiedMessage] = useState(false);
@@ -65,10 +69,14 @@ export const TopNavButtons: React.FC<TopNavButtonsProps> = ({
<SignUpButton
onClick={() => {
- window.location.href = getEnteURL();
+ if (enableJoin) {
+ onJoinAlbum?.();
+ } else {
+ window.location.href = getEnteURL();
+ }
}}
>
- {t("get_ente_photos")}
+ {enableJoin ? t("join_album") : t("get_ente_photos")}
</SignUpButton>
</ButtonContainer>
diff --git a/web/apps/albums/src/public-album/components/TripLayout/index.tsx b/web/apps/albums/src/public-album/components/TripLayout/index.tsx
index 83137ff9e6..8fbd6adda3 100644
--- a/web/apps/albums/src/public-album/components/TripLayout/index.tsx
+++ b/web/apps/albums/src/public-album/components/TripLayout/index.tsx
@@ -71,7 +71,7 @@ export const TripLayout: React.FC<TripLayoutProps> = ({
collectionKey,
credentials,
enableComment = true,
- enableJoin = true,
+ enableJoin = false,
}) => {
// Extract collection info if available
const collectionTitle = collection?.name || albumTitle || "Trip";
@@ -360,6 +360,8 @@ export const TripLayout: React.FC<TripLayoutProps> = ({
enableDownload={enableDownload}
onShowFeed={enableComment ? showPublicFeed : undefined}
collectionTitle={collectionTitle}
+ enableJoin={enableJoin}
+ onJoinAlbum={handleJoinAlbum}
/>
) : (
<TopNavButtons
@@ -367,6 +369,8 @@ export const TripLayout: React.FC<TripLayoutProps> = ({
downloadAllFiles={downloadAllFiles}
enableDownload={enableDownload}
onShowFeed={enableComment ? showPublicFeed : undefined}
+ enableJoin={enableJoin}
+ onJoinAlbum={handleJoinAlbum}
/>
))}
{/* Mobile Layout */}