Cleaning up sheet abstraction to use Ant/flipper-plugin dialogs instead
Summary: This diff cleans up order remaining dialogs, the ones involved in exporting to file or url. Includes some legacy component cleanup boyscouting, but not too much. This removes a lot of code where state of the wizard was stored globally, and makes it locally instead. Other code that was removed involves interaction with the old UI, which allowed import / export to be running in the background as well. (which is no longer needed since we optimised the process) Reviewed By: timur-valiev Differential Revision: D30192000 fbshipit-source-id: 13be883c5bf217a3d58b610b78516359e9bd0ebc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9e5575cf69
commit
d56375970d
@@ -237,6 +237,27 @@ export const Dialog = {
|
||||
});
|
||||
},
|
||||
|
||||
select<T>({
|
||||
defaultValue,
|
||||
renderer,
|
||||
...rest
|
||||
}: {
|
||||
defaultValue: T;
|
||||
renderer: (
|
||||
value: T,
|
||||
onChange: (newValue: T) => void,
|
||||
onCancel: () => void,
|
||||
) => React.ReactElement;
|
||||
} & BaseDialogOptions): DialogResult<false | T> {
|
||||
const handle = Dialog.show<T>({
|
||||
...rest,
|
||||
defaultValue,
|
||||
children: (currentValue, setValue): React.ReactElement =>
|
||||
renderer(currentValue, setValue, () => handle.close()),
|
||||
});
|
||||
return handle;
|
||||
},
|
||||
|
||||
loading({
|
||||
title,
|
||||
message,
|
||||
|
||||
Reference in New Issue
Block a user