mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-31 11:08:26 +01:00
Add a local `tv-search` Expo module that hosts SwiftUI's `.searchable` in a UIHostingController (adapted from expo-tvos-search, minus its native results grid). It emits typed text to React Native so the existing search pipeline and custom TV results grid are reused. Handles the RN-tvOS remote gesture release needed for keyboard input on device. Wire it into TVSearchPage as a sticky header above the scrollable results, with a TVFocusGuideView bridge so focus can move from the tab bar into the native search field.
23 lines
689 B
TypeScript
23 lines
689 B
TypeScript
import { requireNativeView } from "expo";
|
|
import * as React from "react";
|
|
import type { View } from "react-native";
|
|
|
|
import type { TvSearchViewProps } from "./TvSearchView.types";
|
|
|
|
const NativeView: React.ComponentType<
|
|
TvSearchViewProps & React.RefAttributes<View>
|
|
> = requireNativeView("TvSearchModule");
|
|
|
|
/**
|
|
* Forwards its ref to the underlying native view so it can be used as a
|
|
* `TVFocusGuideView` `destinations` target for routing focus into the native
|
|
* search bar.
|
|
*/
|
|
const TvSearchView = React.forwardRef<View, TvSearchViewProps>((props, ref) => {
|
|
return <NativeView ref={ref} {...props} />;
|
|
});
|
|
|
|
TvSearchView.displayName = "TvSearchView";
|
|
|
|
export default TvSearchView;
|