MCPcopy Create free account
hub / github.com/shoutem/ui / getKeyAreaHeights

Method getKeyAreaHeights

components/DropDownMenu/DropDownModal.js:108–129  ·  view source on GitHub ↗
(manualOptionHeight)

Source from the content-addressed store, hash-verified

106 }
107
108 getKeyAreaHeights(manualOptionHeight) {
109 const { optionHeight } = this.state;
110 const { style } = this.props;
111
112 const gradientHeight = manualOptionHeight || optionHeight;
113 const listViewHeight = this.calculateListViewHeight(gradientHeight);
114 const screenHeight = window.height;
115 const paddedScreenHeight = style.modal.paddingVertical
116 ? screenHeight - style.modal.paddingVertical * 2
117 : screenHeight;
118 const bufferHeight = Math.max(
119 (paddedScreenHeight - listViewHeight) / 2,
120 gradientHeight * 2,
121 );
122
123 return {
124 listViewHeight,
125 screenHeight,
126 gradientHeight,
127 bufferHeight,
128 };
129 }
130
131 renderGradient() {
132 const { style } = this.props;

Callers 2

resolveListViewStyleMethod · 0.95
renderGradientMethod · 0.95

Calls 1

Tested by

no test coverage detected