From c892ac29d43f07c36fa62beb514c19bdddfaddf0 Mon Sep 17 00:00:00 2001 From: "t3-code[bot]" <269035359+t3-code[bot]@users.noreply.github.com> Date: Thu, 6 Aug 2026 03:13:52 +0000 Subject: [PATCH] fix(mobile): use glass for pending cards --- .../features/threads/PendingApprovalCard.tsx | 5 +-- .../features/threads/PendingCardSurface.tsx | 35 +++++++++++++++++++ .../features/threads/PendingUserInputCard.tsx | 5 +-- 3 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 apps/mobile/src/features/threads/PendingCardSurface.tsx diff --git a/apps/mobile/src/features/threads/PendingApprovalCard.tsx b/apps/mobile/src/features/threads/PendingApprovalCard.tsx index caf9bd4cd0..61b1f82d7b 100644 --- a/apps/mobile/src/features/threads/PendingApprovalCard.tsx +++ b/apps/mobile/src/features/threads/PendingApprovalCard.tsx @@ -3,6 +3,7 @@ import { Pressable, View } from "react-native"; import { AppText as Text } from "../../components/AppText"; import type { PendingApproval } from "../../lib/threadActivity"; +import { PendingCardSurface } from "./PendingCardSurface"; export interface PendingApprovalCardProps { readonly approval: PendingApproval; @@ -15,7 +16,7 @@ export interface PendingApprovalCardProps { export function PendingApprovalCard(props: PendingApprovalCardProps) { return ( - + Approval needed @@ -52,6 +53,6 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) { Decline - + ); } diff --git a/apps/mobile/src/features/threads/PendingCardSurface.tsx b/apps/mobile/src/features/threads/PendingCardSurface.tsx new file mode 100644 index 0000000000..b1f0b443a8 --- /dev/null +++ b/apps/mobile/src/features/threads/PendingCardSurface.tsx @@ -0,0 +1,35 @@ +import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass"; +import type { ReactNode } from "react"; +import { useColorScheme, View, type ViewStyle } from "react-native"; + +const SURFACE_STYLE: ViewStyle = { + borderRadius: 20, + overflow: "hidden", +}; + +export function PendingCardSurface(props: { readonly children: ReactNode }) { + const isDarkMode = useColorScheme() === "dark"; + const content = {props.children}; + + if (isLiquidGlassSupported) { + return ( + + {content} + + ); + } + + return ( + + {content} + + ); +} diff --git a/apps/mobile/src/features/threads/PendingUserInputCard.tsx b/apps/mobile/src/features/threads/PendingUserInputCard.tsx index 4d2c2c8415..605081507c 100644 --- a/apps/mobile/src/features/threads/PendingUserInputCard.tsx +++ b/apps/mobile/src/features/threads/PendingUserInputCard.tsx @@ -4,6 +4,7 @@ import { Pressable, View } from "react-native"; import { AppText as Text, AppTextInput as TextInput } from "../../components/AppText"; import { cn } from "../../lib/cn"; import type { PendingUserInput, PendingUserInputDraftAnswer } from "../../lib/threadActivity"; +import { PendingCardSurface } from "./PendingCardSurface"; export interface PendingUserInputCardProps { readonly pendingUserInput: PendingUserInput; @@ -25,7 +26,7 @@ export interface PendingUserInputCardProps { export function PendingUserInputCard(props: PendingUserInputCardProps) { return ( - + User input needed @@ -100,6 +101,6 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) { > Submit answers - + ); }