diff --git a/native/profile/default-notifications-preferences.react.js b/native/profile/default-notifications-preferences.react.js index 70fcc4b53..b0b8c3e79 100644 --- a/native/profile/default-notifications-preferences.react.js +++ b/native/profile/default-notifications-preferences.react.js @@ -1,81 +1,100 @@ // @flow import * as React from 'react'; import { View, Text, ScrollView, Platform } from 'react-native'; import Action from '../components/action-row.react'; import SWMansionIcon from '../components/swmansion-icon.react'; +import type { NavigationRoute } from '../navigation/route-names'; import { useStyles } from '../themes/colors'; +import type { ProfileNavigationProp } from './profile.react'; const CheckIcon = () => ( ); type ProfileRowProps = { +content: string, +onPress: () => void, +danger?: boolean, }; function NotificationRow(props: ProfileRowProps): React.Node { const { content, onPress, danger } = props; return ( ); } -// eslint-disable-next-line no-unused-vars -function DefaultNotificationsPreferences(props: { ... }): React.Node { - const styles = useStyles(unboundStyles); +type BaseProps = { + +navigation: ProfileNavigationProp<>, + +route: NavigationRoute<'DefaultNotifications'>, +}; - return ( - - NOTIFICATIONS - - {}} /> - {}} /> - {}} /> - - - ); +type Props = { + ...BaseProps, + styles: typeof unboundStyles, +}; + +class DefaultNotificationsPreferences extends React.PureComponent { + render() { + const { styles } = this.props; + return ( + + NOTIFICATIONS + + {}} /> + {}} /> + {}} /> + + + ); + } } const unboundStyles = { scrollView: { backgroundColor: 'panelBackground', }, scrollViewContentContainer: { paddingTop: 24, }, section: { backgroundColor: 'panelForeground', borderBottomWidth: 1, borderColor: 'panelForegroundBorder', borderTopWidth: 1, marginBottom: 24, marginVertical: 2, }, icon: { lineHeight: Platform.OS === 'ios' ? 18 : 20, }, header: { color: 'panelBackgroundLabel', fontSize: 12, fontWeight: '400', paddingBottom: 3, paddingHorizontal: 24, }, }; -export default DefaultNotificationsPreferences; +const ConnectedDefaultNotificationPreferences: React.ComponentType = React.memo( + function ConnectedDefaultNotificationPreferences(props: BaseProps) { + const styles = useStyles(unboundStyles); + return ; + }, +); + +export default ConnectedDefaultNotificationPreferences;