summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/FolderTrustDialog.tsx
diff options
context:
space:
mode:
authorJacob Richman <[email protected]>2025-08-12 14:05:49 -0700
committerGitHub <[email protected]>2025-08-12 21:05:49 +0000
commitd219f9013206aad5a1361e436ad4a45114e9cd49 (patch)
tree58216dc659e809bc896b03de21a9a1c713126d6b /packages/cli/src/ui/components/FolderTrustDialog.tsx
parent74fd0841d0d7148127e586fce4c550a01ff40e90 (diff)
Switch from useInput to useKeypress. (#6056)
Diffstat (limited to 'packages/cli/src/ui/components/FolderTrustDialog.tsx')
-rw-r--r--packages/cli/src/ui/components/FolderTrustDialog.tsx16
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/cli/src/ui/components/FolderTrustDialog.tsx b/packages/cli/src/ui/components/FolderTrustDialog.tsx
index 1918998c..30f3ff52 100644
--- a/packages/cli/src/ui/components/FolderTrustDialog.tsx
+++ b/packages/cli/src/ui/components/FolderTrustDialog.tsx
@@ -4,13 +4,14 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { Box, Text, useInput } from 'ink';
+import { Box, Text } from 'ink';
import React from 'react';
import { Colors } from '../colors.js';
import {
RadioButtonSelect,
RadioSelectItem,
} from './shared/RadioButtonSelect.js';
+import { useKeypress } from '../hooks/useKeypress.js';
export enum FolderTrustChoice {
TRUST_FOLDER = 'trust_folder',
@@ -25,11 +26,14 @@ interface FolderTrustDialogProps {
export const FolderTrustDialog: React.FC<FolderTrustDialogProps> = ({
onSelect,
}) => {
- useInput((_, key) => {
- if (key.escape) {
- onSelect(FolderTrustChoice.DO_NOT_TRUST);
- }
- });
+ useKeypress(
+ (key) => {
+ if (key.name === 'escape') {
+ onSelect(FolderTrustChoice.DO_NOT_TRUST);
+ }
+ },
+ { isActive: true },
+ );
const options: Array<RadioSelectItem<FolderTrustChoice>> = [
{