summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.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/privacy/CloudFreePrivacyNotice.tsx
parent74fd0841d0d7148127e586fce4c550a01ff40e90 (diff)
Switch from useInput to useKeypress. (#6056)
Diffstat (limited to 'packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx')
-rw-r--r--packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx16
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx b/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx
index 25e14281..d4c13097 100644
--- a/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx
+++ b/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx
@@ -4,12 +4,13 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { Box, Newline, Text, useInput } from 'ink';
+import { Box, Newline, Text } from 'ink';
import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js';
import { usePrivacySettings } from '../hooks/usePrivacySettings.js';
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
import { Config } from '@google/gemini-cli-core';
import { Colors } from '../colors.js';
+import { useKeypress } from '../hooks/useKeypress.js';
interface CloudFreePrivacyNoticeProps {
config: Config;
@@ -23,11 +24,14 @@ export const CloudFreePrivacyNotice = ({
const { privacyState, updateDataCollectionOptIn } =
usePrivacySettings(config);
- useInput((input, key) => {
- if (privacyState.error && key.escape) {
- onExit();
- }
- });
+ useKeypress(
+ (key) => {
+ if (privacyState.error && key.name === 'escape') {
+ onExit();
+ }
+ },
+ { isActive: true },
+ );
if (privacyState.isLoading) {
return <Text color={Colors.Gray}>Loading...</Text>;