Update context menu for new ant design api
Summary: Mostly mechanical change from jsx to object based api. However some changes: 1. Managed to get rid of UIDebugger context menu item. its now possible to listen to when any context menu is clicked 2. The construction code is cleaner. no more mutable arrary and pushing, its just a big spliced literal 3. Had to change how the ide function worked. It is dynamic and used react query hook to update the number of items. Added a callback to recreate this behaviour. Reviewed By: aigoncharov Differential Revision: D48910165 fbshipit-source-id: 9a71f5ecd302e6ff72194f83a13839f78e9b0796
This commit is contained in:
committed by
Facebook GitHub Bot
parent
32ef1bd565
commit
b336ed38fa
14
desktop/plugins/public/ui-debugger/utils/array.tsx
Normal file
14
desktop/plugins/public/ui-debugger/utils/array.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
export function filterOutFalsy<T>(
|
||||
arr: T[],
|
||||
): Exclude<T, false | 0 | '' | null | undefined>[] {
|
||||
return arr.filter(Boolean) as Exclude<T, false | 0 | '' | null | undefined>[];
|
||||
}
|
||||
Reference in New Issue
Block a user