Skip to content

Commit

Permalink
[lib][native] Remove displayFailureAlert prop from `*EditUserAvatar…
Browse files Browse the repository at this point in the history
…Provider`

Summary:
As of D8341 we no longer use or need this prop. Surfacing of errors is handled by platform-specific code for consistency.

Now we just need to get rid of `useUploadSelectedMedia` and we can consolidate `NativeEditUserAvatarProvider`, `WebEditUserAvatarProvider`, and `BaseEditUserAvatarProvider` into a single platform-agnostic `EditUserAvatarProvider`.

---

Depends on D8341

Test Plan: NA/flow/eslint

Reviewers: ashoat, ginsu, rohan

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D8342
  • Loading branch information
atulsmadhugiri committed Jul 28, 2023
1 parent 1dae323 commit 42871bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/components/base-edit-user-avatar-provider.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const updateUserAvatarLoadingStatusSelector = createLoadingStatusSelector(
);

type Props = {
+displayFailureAlert?: () => mixed,
+useUploadSelectedMedia: (
setProcessingOrUploadInProgress?: (inProgress: boolean) => mixed,
) => (selection: NativeMediaSelection) => Promise<?ImageAvatarDBContent>,
Expand Down
10 changes: 2 additions & 8 deletions native/avatars/native-edit-user-avatar-provider.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@ import * as React from 'react';

import { BaseEditUserAvatarProvider } from 'lib/components/base-edit-user-avatar-provider.react.js';

import {
useUploadSelectedMedia,
displayAvatarUpdateFailureAlert,
} from './avatar-hooks.js';
import { useUploadSelectedMedia } from './avatar-hooks.js';

type Props = {
+children: React.Node,
};
function NativeEditUserAvatarProvider(props: Props): React.Node {
const { children } = props;
return (
<BaseEditUserAvatarProvider
displayFailureAlert={displayAvatarUpdateFailureAlert}
useUploadSelectedMedia={useUploadSelectedMedia}
>
<BaseEditUserAvatarProvider useUploadSelectedMedia={useUploadSelectedMedia}>
{children}
</BaseEditUserAvatarProvider>
);
Expand Down

0 comments on commit 42871bb

Please sign in to comment.