From 42871bb1c4bbbbb1f1416a83e3826014761e3b35 Mon Sep 17 00:00:00 2001 From: Atul Madhugiri Date: Fri, 28 Jul 2023 12:55:02 -0700 Subject: [PATCH] [lib][native] Remove `displayFailureAlert` prop from `*EditUserAvatarProvider` 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 --- lib/components/base-edit-user-avatar-provider.react.js | 1 - .../avatars/native-edit-user-avatar-provider.react.js | 10 ++-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/components/base-edit-user-avatar-provider.react.js b/lib/components/base-edit-user-avatar-provider.react.js index ad787b1264..51a7f6d846 100644 --- a/lib/components/base-edit-user-avatar-provider.react.js +++ b/lib/components/base-edit-user-avatar-provider.react.js @@ -46,7 +46,6 @@ const updateUserAvatarLoadingStatusSelector = createLoadingStatusSelector( ); type Props = { - +displayFailureAlert?: () => mixed, +useUploadSelectedMedia: ( setProcessingOrUploadInProgress?: (inProgress: boolean) => mixed, ) => (selection: NativeMediaSelection) => Promise, diff --git a/native/avatars/native-edit-user-avatar-provider.react.js b/native/avatars/native-edit-user-avatar-provider.react.js index 88c27733a3..d34c81a8f1 100644 --- a/native/avatars/native-edit-user-avatar-provider.react.js +++ b/native/avatars/native-edit-user-avatar-provider.react.js @@ -4,10 +4,7 @@ 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, @@ -15,10 +12,7 @@ type Props = { function NativeEditUserAvatarProvider(props: Props): React.Node { const { children } = props; return ( - + {children} );