diff --git a/lib/hooks/promote-sidebar.react.js b/lib/hooks/promote-sidebar.react.js --- a/lib/hooks/promote-sidebar.react.js +++ b/lib/hooks/promote-sidebar.react.js @@ -13,13 +13,13 @@ import { useSelector } from '../utils/redux-utils'; type PromoteSidebarType = { - onPromoteSidebar: () => mixed, - loading: LoadingStatus, + +onPromoteSidebar: () => void, + +loading: LoadingStatus, }; function usePromoteSidebar( threadInfo: ThreadInfo, - onError?: (error: string) => mixed, + onError?: (error: Error) => mixed, ): PromoteSidebarType { const dispatchActionPromise = useDispatchActionPromise(); const callChangeThreadSettings = useServerCall(changeThreadSettings); diff --git a/native/chat/settings/thread-settings-promote-sidebar.react.js b/native/chat/settings/thread-settings-promote-sidebar.react.js --- a/native/chat/settings/thread-settings-promote-sidebar.react.js +++ b/native/chat/settings/thread-settings-promote-sidebar.react.js @@ -1,28 +1,13 @@ // @flow import * as React from 'react'; -import { Text, Alert, ActivityIndicator, View } from 'react-native'; +import { Text, ActivityIndicator, View, Alert } from 'react-native'; -import { - changeThreadSettingsActionTypes, - changeThreadSettings, -} from 'lib/actions/thread-actions'; -import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors'; +import { usePromoteSidebar } from 'lib/hooks/promote-sidebar.react'; import type { LoadingStatus } from 'lib/types/loading-types'; -import { - type ThreadInfo, - type UpdateThreadRequest, - type ChangeThreadSettingsPayload, - threadTypes, -} from 'lib/types/thread-types'; -import { - type DispatchActionPromise, - useServerCall, - useDispatchActionPromise, -} from 'lib/utils/action-utils'; +import type { ThreadInfo } from 'lib/types/thread-types'; import Button from '../../components/button.react'; -import { useSelector } from '../../redux/redux-utils'; import { type Colors, useColors, useStyles } from '../../themes/colors'; import type { ViewStyle } from '../../types/styles'; @@ -32,16 +17,10 @@ }; type Props = { ...BaseProps, - // Redux state +loadingStatus: LoadingStatus, +colors: Colors, +styles: typeof unboundStyles, - // Redux dispatch functions - +dispatchActionPromise: DispatchActionPromise, - // async functions that hit server APIs - +changeThreadSettings: ( - request: UpdateThreadRequest, - ) => Promise, + +promoteSidebar: () => mixed, }; class ThreadSettingsPromoteSidebar extends React.PureComponent { render() { @@ -56,7 +35,7 @@ return (