diff --git a/native/chat/settings/thread-settings-home-notifs.react.js b/native/chat/settings/thread-settings-home-notifs.react.js deleted file mode 100644 --- a/native/chat/settings/thread-settings-home-notifs.react.js +++ /dev/null @@ -1,118 +0,0 @@ -// @flow - -import * as React from 'react'; -import { Switch, View } from 'react-native'; - -import { - updateSubscriptionActionTypes, - useUpdateSubscription, -} from 'lib/actions/user-actions.js'; -import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { - SubscriptionUpdateRequest, - SubscriptionUpdateResult, -} from 'lib/types/subscription-types.js'; -import { - type DispatchActionPromise, - useDispatchActionPromise, -} from 'lib/utils/redux-promise-utils.js'; - -import SingleLine from '../../components/single-line.react.js'; -import { useStyles } from '../../themes/colors.js'; - -const unboundStyles = { - currentValue: { - alignItems: 'flex-end', - margin: 0, - paddingLeft: 4, - paddingRight: 0, - paddingVertical: 0, - }, - label: { - color: 'panelForegroundTertiaryLabel', - fontSize: 16, - flex: 1, - }, - row: { - alignItems: 'center', - backgroundColor: 'panelForeground', - flexDirection: 'row', - paddingHorizontal: 24, - paddingVertical: 3, - }, -}; - -type BaseProps = { - +threadInfo: ThreadInfo, -}; -type Props = { - ...BaseProps, - // Redux state - +styles: $ReadOnly, - // Redux dispatch functions - +dispatchActionPromise: DispatchActionPromise, - // async functions that hit server APIs - +updateSubscription: ( - subscriptionUpdate: SubscriptionUpdateRequest, - ) => Promise, -}; -type State = { - +currentValue: boolean, -}; -class ThreadSettingsHomeNotifs extends React.PureComponent { - constructor(props: Props) { - super(props); - this.state = { - currentValue: !props.threadInfo.currentUser.subscription.home, - }; - } - - render(): React.Node { - const componentLabel = 'Background'; - return ( - - - {componentLabel} - - - - - - ); - } - - onValueChange = (value: boolean) => { - this.setState({ currentValue: value }); - void this.props.dispatchActionPromise( - updateSubscriptionActionTypes, - this.props.updateSubscription({ - threadID: this.props.threadInfo.id, - updatedFields: { - home: !value, - }, - }), - ); - }; -} - -const ConnectedThreadSettingsHomeNotifs: React.ComponentType = - React.memo(function ConnectedThreadSettingsHomeNotifs( - props: BaseProps, - ) { - const styles = useStyles(unboundStyles); - const dispatchActionPromise = useDispatchActionPromise(); - const callUpdateSubscription = useUpdateSubscription(); - return ( - - ); - }); - -export default ConnectedThreadSettingsHomeNotifs; diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js --- a/native/chat/settings/thread-settings.react.js +++ b/native/chat/settings/thread-settings.react.js @@ -66,7 +66,6 @@ import ThreadSettingsDeleteThread from './thread-settings-delete-thread.react.js'; import ThreadSettingsDescription from './thread-settings-description.react.js'; import ThreadSettingsEditRelationship from './thread-settings-edit-relationship.react.js'; -import ThreadSettingsHomeNotifs from './thread-settings-home-notifs.react.js'; import ThreadSettingsLeaveThread from './thread-settings-leave-thread.react.js'; import { ThreadSettingsAddMember, @@ -191,11 +190,6 @@ +threadInfo: ResolvedThreadInfo, +navigate: ThreadSettingsNavigate, } - | { - +itemType: 'homeNotifs', - +key: string, - +threadInfo: ResolvedThreadInfo, - } | { +itemType: 'seeMore', +key: string, @@ -468,13 +462,6 @@ threadInfo, navigate, }); - if (threadInfo.type !== threadTypes.SIDEBAR) { - listData.push({ - itemType: 'homeNotifs', - key: 'homeNotifs', - threadInfo, - }); - } listData.push({ itemType: 'footer', key: 'notificationsFooter', @@ -1003,8 +990,6 @@ navigate={item.navigate} /> ); - } else if (item.itemType === 'homeNotifs') { - return ; } else if (item.itemType === 'seeMore') { return ; } else if (item.itemType === 'childThread') {