Improve framework event filters

Reviewed By: lblasa

Differential Revision: D48393422

fbshipit-source-id: 18d92b53bd56c100b6d4bb6adc07ede0b4a46732
This commit is contained in:
Luke De Feo
2023-08-21 04:24:16 -07:00
committed by Facebook GitHub Bot
parent 756a289883
commit 1bffe8bc6b
5 changed files with 225 additions and 92 deletions

View File

@@ -21,6 +21,7 @@ import {
import {tracker} from '../../utils/tracker';
import {debounce} from 'lodash';
import {WireFrameMode} from '../../DesktopTypes';
import {SelectableDropDownItem} from '../shared/SelectableDropDownItem';
export type TargetModeState =
| {
state: 'selected';
@@ -182,31 +183,6 @@ export function VisualiserControls({
);
}
function SelectableDropDownItem<T>({
value,
selectedValue,
onSelect,
text,
}: {
value: T;
selectedValue: T;
onSelect: (value: T) => void;
text: string;
}) {
return (
<Menu.Item
style={{
color:
value === selectedValue ? theme.primaryColor : theme.textColorActive,
}}
onClick={() => {
onSelect(value);
}}>
{text}
</Menu.Item>
);
}
const debouncedReportTargetAdjusted = debounce(() => {
tracker.track('target-mode-adjusted', {});
}, 500);