TV: fix navigation on login (#494)

This commit is contained in:
herrrta
2025-02-07 21:57:13 -05:00
committed by GitHub
parent 33adea2819
commit 6cc90b46b3

View File

@@ -1,10 +1,24 @@
import React from "react";
import { TextInput, TextInputProps } from "react-native";
import {Platform, TextInput, TextInputProps, TouchableOpacity} from "react-native";
export function Input(props: TextInputProps) {
const { style, ...otherProps } = props;
const inputRef = React.useRef<TextInput>(null);
return (
return Platform.isTV ? (
<TouchableOpacity
onFocus={() => inputRef?.current?.focus?.()}
>
<TextInput
ref={inputRef}
className="p-4 rounded-xl bg-neutral-900"
allowFontScaling={false}
style={[{ color: "white" }, style]}
placeholderTextColor={"#9CA3AF"}
clearButtonMode="while-editing"
{...otherProps}
/>
</TouchableOpacity>
) : (
<TextInput
ref={inputRef}
className="p-4 rounded-xl bg-neutral-900"
@@ -14,5 +28,5 @@ export function Input(props: TextInputProps) {
clearButtonMode="while-editing"
{...otherProps}
/>
);
)
}