diff --git a/desktop/app/src/index.tsx b/desktop/app/src/index.tsx index 301018ca0..efa9caad0 100644 --- a/desktop/app/src/index.tsx +++ b/desktop/app/src/index.tsx @@ -175,7 +175,10 @@ export { ElementSearchResultSet, ElementsInspectorProps, } from './ui/components/elements-inspector/ElementsInspector'; -export {Elements} from './ui/components/elements-inspector/elements'; +export { + Elements, + ElementsConstants, +} from './ui/components/elements-inspector/elements'; export {ContextMenuExtension} from './ui/components/elements-inspector/elements'; export {default as ElementsInspector} from './ui/components/elements-inspector/ElementsInspector'; export {InspectorSidebar} from './ui/components/elements-inspector/sidebar'; diff --git a/desktop/app/src/ui/components/elements-inspector/elements.tsx b/desktop/app/src/ui/components/elements-inspector/elements.tsx index 5d0ab2cf0..ebefd1d64 100644 --- a/desktop/app/src/ui/components/elements-inspector/elements.tsx +++ b/desktop/app/src/ui/components/elements-inspector/elements.tsx @@ -20,7 +20,9 @@ import {clipboard, MenuItemConstructorOptions} from 'electron'; import React, {MouseEvent, KeyboardEvent} from 'react'; import {Scrollable} from '../..'; -export const ROW_HEIGHT = 23; +export const ElementsConstants = { + rowHeight: 23, +}; const backgroundColor = (props: { selected: boolean; @@ -58,7 +60,7 @@ const ElementsRowContainer = styled(ContextMenu)((props) => ({ color: props.selected || props.focused ? colors.white : colors.grapeDark3, flexShrink: 0, flexWrap: 'nowrap', - height: ROW_HEIGHT, + height: ElementsConstants.rowHeight, paddingLeft: (props.level - 1) * 12, paddingRight: 20, position: 'relative', @@ -86,10 +88,10 @@ ElementsRowDecoration.displayName = 'Elements:ElementsRowDecoration'; const ElementsLine = styled.div<{childrenCount: number}>((props) => ({ backgroundColor: colors.light20, - height: props.childrenCount * ROW_HEIGHT - 4, + height: props.childrenCount * ElementsConstants.rowHeight - 4, position: 'absolute', right: 3, - top: ROW_HEIGHT - 3, + top: ElementsConstants.rowHeight - 3, zIndex: 2, width: 2, borderRadius: '999em', diff --git a/desktop/plugins/layout/MultipleSelectionSection.tsx b/desktop/plugins/layout/MultipleSelectionSection.tsx index 3290dc55c..36417171f 100644 --- a/desktop/plugins/layout/MultipleSelectionSection.tsx +++ b/desktop/plugins/layout/MultipleSelectionSection.tsx @@ -11,6 +11,7 @@ import { FlexColumn, FlexBox, Element, + ElementsConstants, ElementID, ElementsInspector, Glyph, @@ -18,10 +19,9 @@ import { styled, } from 'flipper'; import React, {memo, useState} from 'react'; -import {ROW_HEIGHT} from '../../app/src/ui/components/elements-inspector/elements'; const MultipleSelectorSectionContainer = styled(FlexColumn)({ - maxHeight: 3 * ROW_HEIGHT + 24, + maxHeight: 3 * ElementsConstants.rowHeight + 24, }); const MultipleSelectorSectionTitle = styled(FlexBox)({