import React, { useMemo } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import type { NativeStackScreenProps } from '@react-navigation/native-stack'; import type { ServicesStackParamList } from '../../../navigation/types'; import { ScreenShell } from '../../../components'; import { ServiceGridItem } from '../../home/components/ServiceGridItem'; import { useTheme, fontFamily } from '../../../theme'; import { ChequeAnimation } from '../components/ChequeAnimation'; import { FeatureKey } from '../../../constants/featureKeys'; import { useEnabledItems } from '../../../features'; type Props = NativeStackScreenProps; export default function ChequeServicesHubScreen({ navigation }: Props) { const theme = useTheme(); const options = useMemo( () => [ { id: 'request', feature: FeatureKey.SERVICES_CHEQUE_BOOK_REQUEST, title: 'Book Request', icon: 'book-outline', iconColor: theme.colors.info, onPress: () => navigation.navigate('ChequeBookRequest'), }, { id: 'stop', feature: FeatureKey.SERVICES_CHEQUE_STOP_PAYMENT, title: 'Stop Payment', icon: 'stop-circle-outline', iconColor: theme.colors.danger, onPress: () => navigation.navigate('StopPayment'), }, { /** * Its key has always been `services.cheque.positivePay` — a child of * this hub — but the only tile pointing at it lived on the * service-requests hub. That hub is off, which left the screen * reachable by global search alone. This is where it belongs. */ id: 'positive_pay', feature: FeatureKey.SERVICES_CHEQUE_POSITIVE_PAY, title: 'Positive Pay', icon: 'shield-checkmark-outline', iconColor: theme.colors.primary, onPress: () => navigation.navigate('PositivePay'), }, { id: 'track', feature: FeatureKey.SERVICES_CHEQUE_TRACKING, title: 'Track Cheques', icon: 'git-compare-outline', iconColor: theme.colors.success, onPress: () => navigation.navigate('ChequeTracking'), }, ], [navigation, theme] ); const visibleOptions = useEnabledItems(options); return ( {/* Animated cheque illustration */} {/* Quick info strip */} Request, track, register, or stop cheques — all in one place {/* Service grid */} {visibleOptions.map((opt) => ( ))} ); } const styles = StyleSheet.create({ grid: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', paddingTop: 8, }, infoStrip: { flexDirection: 'row', alignItems: 'center', gap: 10, borderRadius: 12, borderWidth: 1, paddingHorizontal: 14, paddingVertical: 12, marginBottom: 16, }, infoDot: { width: 6, height: 6, borderRadius: 3, }, infoText: { fontSize: 12, fontFamily: fontFamily.semibold, flex: 1, lineHeight: 17, }, });