authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-07-28 11:08:43+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-07-28 11:08:43+02:00
logd25b15737a058614ab6632bbad23d2497e49b62c
tree16c09aba21856949fa77b6ebe5eeacd778d007c1
parentb0c4992c79605ec310ed9fee6b60fad6e145def4
signature Signed by PGP key B5690EEEBB952194

Fix mobile showcase workflow without Clerk (#4718)


1 files changed, 25 insertions(+), 10 deletions(-)

apps/mobile/src/features/connection/CloudEnvironmentRows.tsx+25-10
......@@ -24,13 +24,7 @@ import { availableCloudEnvironmentPresentation } from "../cloud/cloudEnvironment
2424import { ConnectionStatusDot } from "./ConnectionStatusDot";
2525import { type RelayEnvironmentView, useConnectionController } from "./useConnectionController";
2626
27/**
28 * "T3 Connect" section: every environment published to the signed-in account,
29 * with connect switches, availability status, refresh, and loading/error
30 * states. Shared between the Settings environments screen and the T3 Connect
31 * onboarding sheet.
32 */
33export function CloudEnvironmentRows(props: {
27interface CloudEnvironmentRowsProps {
3428 readonly connectedCloudEnvironments: ReadonlyArray<ConnectedEnvironmentSummary>;
3529 readonly onReconnectEnvironment: (environmentId: EnvironmentId) => void;
3630 readonly showcaseAvailableEnvironments?: ReadonlyArray<RelayEnvironmentView>;
......@@ -41,8 +35,31 @@ export function CloudEnvironmentRows(props: {
4135 * pull-to-refresh).
4236 */
4337 readonly showHeader?: boolean;
44}) {
38}
39
40/**
41 * "T3 Connect" section: every environment published to the signed-in account,
42 * with connect switches, availability status, refresh, and loading/error
43 * states. Shared between the Settings environments screen and the T3 Connect
44 * onboarding sheet.
45 */
46export function CloudEnvironmentRows(props: CloudEnvironmentRowsProps) {
47 // Showcase captures run without a Clerk publishable key, so `ClerkProvider`
48 // is never mounted and any `useAuth` call throws — the fixture states whether
49 // the rows are signed in instead of asking Clerk.
50 if (props.showcaseSignedIn !== undefined) {
51 return props.showcaseSignedIn ? <CloudEnvironmentRowsContent {...props} /> : null;
52 }
53 return <SignedInCloudEnvironmentRows {...props} />;
54}
55
56function SignedInCloudEnvironmentRows(props: CloudEnvironmentRowsProps) {
4557 const { isSignedIn } = useAuth({ treatPendingAsSignedOut: false });
58 if (!isSignedIn) return null;
59 return <CloudEnvironmentRowsContent {...props} />;
60}
61
62function CloudEnvironmentRowsContent(props: CloudEnvironmentRowsProps) {
4663 const controller = useConnectionController();
4764 const iconColor = useThemeColor("--color-icon");
4865 const availableCloudEnvironments =
......@@ -67,8 +84,6 @@ export function CloudEnvironmentRows(props: {
6784
6885 const showHeader = props.showHeader ?? true;
6986
70 if (!(props.showcaseSignedIn ?? isSignedIn)) return null;
71
7287 return (
7388 <View collapsable={false} className={cn("gap-3", showHeader && "mt-5")}>
7489 {showHeader ? (