Switch from useInput to useKeypress. (#6056)

This commit is contained in:
Jacob Richman
2025-08-12 14:05:49 -07:00
committed by GitHub
parent 74fd0841d0
commit d219f90132
19 changed files with 350 additions and 259 deletions

View File

@@ -4,19 +4,23 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { Box, Newline, Text, useInput } from 'ink';
import { Box, Newline, Text } from 'ink';
import { Colors } from '../colors.js';
import { useKeypress } from '../hooks/useKeypress.js';
interface GeminiPrivacyNoticeProps {
onExit: () => void;
}
export const GeminiPrivacyNotice = ({ onExit }: GeminiPrivacyNoticeProps) => {
useInput((input, key) => {
if (key.escape) {
onExit();
}
});
useKeypress(
(key) => {
if (key.name === 'escape') {
onExit();
}
},
{ isActive: true },
);
return (
<Box flexDirection="column" marginBottom={1}>