Skip to Content

🎞️ Watch History Screen

An elegant implementation of the WatchHistory component that presents users with a scrollable grid of previously watched movies, shows, and live streams — complete with theming, empty/loading states, and customization options.


📸 Preview

Watch History Light Preview
Watch History Dark Preview

⚙️ Key Features

FeatureDescription
🎯 Grid LayoutDisplays history items in a responsive grid using react-native-super-grid
🌃 Theme SupportAdapts styling based on app theme
🕐 Loading StatesShows skeleton UI while data is fetching
📬 Empty StatesShows fallback UI when no history data is found
🔍 Search & BackOptional handlers for navigation actions
🧹 Extendable UIAccepts custom renderers for header, items, skeletons, and empty states

📡 API Call Methods

⚙️ First, set up the getZezoOtt API client: API Client Setup

🧪 The following API method is used to fetch user watch history:


🧑‍💻 Example Usage

UserHistoryScreen.tsx
import React from "react"; import { SafeAreaWrapper, WatchHistory, } from "@zezosoft/zezo-ott-react-native-ui-kit"; import { goBack } from "@ZezoOtt/utils/NavigationUtil"; const UserHistoryScreen = () => { return ( <SafeAreaWrapper> <WatchHistory data={[]} // your API response array of watch history data onBackPress={() => goBack()} onSearchPress={() => {}} /> </SafeAreaWrapper> ); }; export default UserHistoryScreen;

🔗 See related route definition: Route enum from @navigation/routes.ts


📦 WatchHistory Props

PropTypeDescription
dataIHistoryItem[]Array of previously watched content
isLoadingbooleanWhether the data is currently loading
titlestringOptional header title
headerComponentReact.ReactNodeCustom header override
onBackPress() => voidBack navigation callback
onSearchPress() => voidSearch icon action handler
showSearchIconbooleanToggle search icon visibility
itemDimensionnumberWidth of each grid item
spacingnumberGrid item spacing
renderItem(item, index) => ReactElementCustom item renderer
skeletonCountnumberNumber of loading skeletons shown
skeletonComponentReactElementCustom skeleton component
noDataComponentReact.ReactNodeCustom fallback UI when no data available
noDataTextstringText shown when no history is found
onPressItem(item) => voidCallback for item press
onEndReached() => voidTriggers when scroll reaches bottom
onEndReachedThresholdnumberScroll threshold to trigger pagination

🧠 Behavior Notes

  • Uses CardPoster as the default item renderer
  • Handles layout with FlatGrid
  • Theming support via useTheme()
  • Designed for plug-and-play integration

✅ Summary

  • 🎥 Displays a rich, scrollable grid of watch history content
  • 🧹 Fully customizable with render props and overrides
  • 🌃 Supports dark/light themes out of the box
  • 🚀 Ready-to-use and compatible with real data fetching (e.g. react-query)
  • 📬 Smooth fallback experience for empty and loading states

✍️ Created by Naresh Dhamu – Powered by ZezoSoft.

Last updated on