From cc39ec1008ce584e088e79210b69d3359357463b Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 17 Sep 2026 20:29:11 -0700 Subject: [PATCH] fix(mobile): share request action button defaults (#12366) --- .../features/threads/PendingApprovalCard.tsx | 30 +++++-------- .../features/threads/PendingUserInputCard.tsx | 21 +++------ .../features/threads/RequestActionButton.tsx | 45 +++++++++++++++++++ .../threads/ThreadCreationFailedCard.tsx | 11 ++--- 4 files changed, 64 insertions(+), 43 deletions(-) create mode 100644 apps/mobile/src/features/threads/RequestActionButton.tsx diff --git a/apps/mobile/src/features/threads/PendingApprovalCard.tsx b/apps/mobile/src/features/threads/PendingApprovalCard.tsx index 4be6ff611842fdf7419150480f8425877c1d697f..a0fef485e3db975bef6ceed08d3dd7cd49b992b2 100644 --- a/apps/mobile/src/features/threads/PendingApprovalCard.tsx +++ b/apps/mobile/src/features/threads/PendingApprovalCard.tsx @@ -1,9 +1,10 @@ +import { RequestActionButton } from "./RequestActionButton"; import type { ApprovalRequestId, ProviderApprovalDecision, ProviderApprovalOption, } from "@t3tools/contracts"; -import { Pressable, View } from "react-native"; +import { View } from "react-native"; import { AppText as Text } from "../../components/AppText"; import type { PendingApproval } from "../../lib/threadActivity"; @@ -47,30 +48,19 @@ export function PendingApprovalCard(props: PendingApprovalCardProps) { ) : null} {options.map((option) => ( - void props.onRespond(props.approval.requestId, option.decision)} - > - - {option.label} - - + /> ))} diff --git a/apps/mobile/src/features/threads/PendingUserInputCard.tsx b/apps/mobile/src/features/threads/PendingUserInputCard.tsx index 80fe6be689bb536cb94a3b353d72c0d320210c37..3730b18aff7a038487a0d7dab4bae2768089e816 100644 --- a/apps/mobile/src/features/threads/PendingUserInputCard.tsx +++ b/apps/mobile/src/features/threads/PendingUserInputCard.tsx @@ -1,3 +1,4 @@ +import { RequestActionButton } from "./RequestActionButton"; import { QuestionAttachments } from "./QuestionAttachments"; import type { ApprovalRequestId, UserInputQuestion } from "@t3tools/contracts"; import { useCallback, useRef } from "react"; @@ -321,25 +322,15 @@ export function PendingUserInputCard(props: PendingUserInputCardProps) { ); })} - void props.onSubmit()} - > - - Submit answers - - + /> {props.pendingUserInput.dismissible ? ( , "children" | "className" | "style"> & { + label: string; + tone?: "primary" | "secondary" | "danger"; + size?: "default" | "large"; +}) { + return ( + + + {label} + + + ); +} diff --git a/apps/mobile/src/features/threads/ThreadCreationFailedCard.tsx b/apps/mobile/src/features/threads/ThreadCreationFailedCard.tsx index 71b80e5ccc3b246d51db56d6478549e849176bcc..dce4cb3797b74c187f591a16c0cdffbc916ad6f1 100644 --- a/apps/mobile/src/features/threads/ThreadCreationFailedCard.tsx +++ b/apps/mobile/src/features/threads/ThreadCreationFailedCard.tsx @@ -1,4 +1,5 @@ -import { Pressable, View } from "react-native"; +import { RequestActionButton } from "./RequestActionButton"; +import { View } from "react-native"; import { AppText as Text } from "../../components/AppText"; @@ -23,13 +24,7 @@ export function ThreadCreationFailedCard(props: { Your prompt was kept in the project draft. - - Edit task - + ); -- 2.54.0