diff --git a/desktop/plugins/public/ui-debugger/components/shared/SelectableDropDownItem.tsx b/desktop/plugins/public/ui-debugger/components/shared/SelectableDropDownItem.tsx deleted file mode 100644 index e18e12558..000000000 --- a/desktop/plugins/public/ui-debugger/components/shared/SelectableDropDownItem.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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 - */ - -import {Menu} from 'antd'; -import {theme} from 'flipper-plugin'; -import React from 'react'; - -export function SelectableDropDownItem({ - value, - selectedValue, - onSelect, - text, -}: { - value: T; - selectedValue: T; - onSelect: (value: T) => void; - text: string; -}) { - return ( - { - onSelect(value); - }}> - {text} - - ); -} diff --git a/desktop/plugins/public/ui-debugger/components/visualizer/VisualizerControls.tsx b/desktop/plugins/public/ui-debugger/components/visualizer/VisualizerControls.tsx index 9c7e558c8..7c7a27dcd 100644 --- a/desktop/plugins/public/ui-debugger/components/visualizer/VisualizerControls.tsx +++ b/desktop/plugins/public/ui-debugger/components/visualizer/VisualizerControls.tsx @@ -21,7 +21,6 @@ import { import {tracker} from '../../utils/tracker'; import {debounce} from 'lodash'; import {WireFrameMode} from '../../DesktopTypes'; -import {SelectableDropDownItem} from '../shared/SelectableDropDownItem'; export type TargetModeState = | { state: 'selected'; @@ -35,6 +34,16 @@ export type TargetModeState = state: 'disabled'; }; +function createItem(wireframeMode: WireFrameMode, label: string) { + return {key: wireframeMode, label: label}; +} + +const wireFrameModeDropDownItems = [ + createItem('All', 'All'), + createItem('SelectedAndChildren', 'Selected and children'), + createItem('SelectedOnly', 'Selected only'), +]; + export function VisualiserControls({ targetMode, setTargetMode, @@ -98,28 +107,14 @@ export function VisualiserControls({ - - - - - }> + menu={{ + selectable: true, + selectedKeys: [wireFrameMode], + items: wireFrameModeDropDownItems, + onSelect: (event) => { + onSetWireFrameMode(event.selectedKeys[0] as WireFrameMode); + }, + }}>