MCPcopy
hub / github.com/callstack/react-native-paper / calculatePadding

Function calculatePadding

src/components/TextInput/helpers.tsx:74–88  ·  view source on GitHub ↗
(props: PaddingProps)

Source from the content-addressed store, hash-verified

72};
73
74export const calculatePadding = (props: PaddingProps): number => {
75 const { height, multiline = false } = props;
76
77 let result = 0;
78
79 if (multiline) {
80 if (height && multiline) {
81 result = calculateTextAreaPadding(props);
82 } else {
83 result = calculateInputPadding(props);
84 }
85 }
86
87 return Math.max(0, result);
88};
89
90const calculateTextAreaPadding = (props: PaddingProps) => {
91 const { dense } = props;

Callers 2

TextInputFlatFunction · 0.90
TextInputOutlinedFunction · 0.90

Calls 2

calculateTextAreaPaddingFunction · 0.85
calculateInputPaddingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…