diff --git a/native/apps/apps-directory.react.js b/native/apps/apps-directory.react.js --- a/native/apps/apps-directory.react.js +++ b/native/apps/apps-directory.react.js @@ -3,13 +3,23 @@ import * as React from 'react'; import { Text, FlatList, View } from 'react-native'; +import type { SupportedApps } from 'lib/types/enabled-apps.js'; + import AppListing from './app-listing.react.js'; import type { NavigationRoute } from '../navigation/route-names.js'; import type { TabNavigationProp } from '../navigation/tab-navigator.react.js'; import { useSelector } from '../redux/redux-utils.js'; import { useStyles } from '../themes/colors.js'; -const APP_DIRECTORY_DATA = [ +type Item = { + +id: SupportedApps | 'chat', + +alwaysEnabled: boolean, + +appName: string, + +appIcon: 'message-square' | 'calendar', + +appCopy: string, +}; + +const APP_DIRECTORY_DATA: $ReadOnlyArray = [ { id: 'chat', alwaysEnabled: true, @@ -36,10 +46,10 @@ const enabledApps = useSelector(state => state.enabledApps); const renderAppCell = React.useCallback( - ({ item }) => ( + ({ item }: { +item: Item, ... }) => ( item.id, []); + const getItemID = React.useCallback((item: Item) => item.id, []); return (