diff --git a/desktop/plugins/public/ui-debugger/components/Controls.tsx b/desktop/plugins/public/ui-debugger/components/Controls.tsx index 6a5d5fdd9..aff0b41d2 100644 --- a/desktop/plugins/public/ui-debugger/components/Controls.tsx +++ b/desktop/plugins/public/ui-debugger/components/Controls.tsx @@ -6,11 +6,26 @@ * * @format */ -import React from 'react'; +import React, {useState} from 'react'; import {plugin} from '../index'; -import {Button, Input, Tooltip} from 'antd'; -import {PauseCircleOutlined, PlayCircleOutlined} from '@ant-design/icons'; +import { + Button, + Input, + Modal, + Tooltip, + Dropdown, + Menu, + Typography, + TreeSelect, + Space, +} from 'antd'; +import { + MoreOutlined, + PauseCircleOutlined, + PlayCircleOutlined, +} from '@ant-design/icons'; import {usePlugin, useValue, Layout} from 'flipper-plugin'; +import {FrameworkEventType} from '../types'; /** * Copyright (c) Meta Platforms, Inc. and affiliates. @@ -25,6 +40,20 @@ export const Controls: React.FC = () => { const instance = usePlugin(plugin); const searchTerm = useValue(instance.uiState.searchTerm); const isPaused = useValue(instance.uiState.isPaused); + + const frameworkEventMonitoring: Map = useValue( + instance.uiState.frameworkEventMonitoring, + ); + + const onSetEventMonitored: ( + eventType: FrameworkEventType, + monitored: boolean, + ) => void = (eventType: FrameworkEventType, monitored: boolean) => { + instance.uiState.frameworkEventMonitoring.update((draft) => + draft.set(eventType, monitored), + ); + }; + return ( { {isPaused ? : } }> + ); }; + +function MoreOptionsMenu({ + onSetEventMonitored, + frameworkEventTypes, +}: { + onSetEventMonitored: ( + eventType: FrameworkEventType, + monitored: boolean, + ) => void; + frameworkEventTypes: [FrameworkEventType, boolean][]; +}) { + const [showFrameworkEventsModal, setShowFrameworkEventsModal] = + useState(false); + + const moreOptionsMenu = ( + + { + setShowFrameworkEventsModal(true); + }}> + Framework event monitoring + + + ); + + return ( + <> + +