MCPcopy Create free account
hub / github.com/callstack/react-native-paper / getContentMaxWidth

Function getContentMaxWidth

src/components/Menu/utils.ts:87–110  ·  view source on GitHub ↗
({
  isV3,
  iconWidth,
  leadingIcon,
  trailingIcon,
}: ContentProps)

Source from the content-addressed store, hash-verified

85};
86
87export const getContentMaxWidth = ({
88 isV3,
89 iconWidth,
90 leadingIcon,
91 trailingIcon,
92}: ContentProps) => {
93 if (isV3) {
94 if (leadingIcon && trailingIcon) {
95 return MAX_WIDTH - (2 * iconWidth + 24);
96 }
97
98 if (leadingIcon || trailingIcon) {
99 return MAX_WIDTH - (iconWidth + 24);
100 }
101
102 return MAX_WIDTH - 12;
103 }
104
105 if (leadingIcon) {
106 return MAX_WIDTH - (iconWidth + 48);
107 }
108
109 return MAX_WIDTH - 16;
110};

Callers 1

MenuItemFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…