|
13 | 13 |
|
14 | 14 | namespace facebook::react {
|
15 | 15 |
|
16 |
| -static bool hasValue( |
17 |
| - const RawProps& rawProps, |
18 |
| - bool defaultValue, |
19 |
| - const char* name, |
20 |
| - const char* prefix, |
21 |
| - const char* suffix) { |
22 |
| - auto rawValue = rawProps.at(name, prefix, suffix); |
| 16 | +static bool |
| 17 | +hasValue(const RawProps& rawProps, bool defaultValue, const char* name) { |
| 18 | + auto rawValue = rawProps.at(name, nullptr, nullptr); |
23 | 19 |
|
24 | 20 | // No change to prop - use default
|
25 | 21 | if (rawValue == nullptr) {
|
@@ -217,47 +213,35 @@ AndroidTextInputProps::AndroidTextInputProps(
|
217 | 213 | convertRawProp(context, rawProps, sourceProps.paragraphAttributes, {})),
|
218 | 214 | // See AndroidTextInputComponentDescriptor for usage
|
219 | 215 | // TODO T63008435: can these, and this feature, be removed entirely?
|
220 |
| - hasPadding(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPadding : hasValue(rawProps, sourceProps.hasPadding, "", "padding", "")), |
| 216 | + hasPadding(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPadding : hasValue(rawProps, sourceProps.hasPadding, "padding")), |
221 | 217 | hasPaddingHorizontal(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingHorizontal : hasValue(
|
222 | 218 | rawProps,
|
223 | 219 | sourceProps.hasPaddingHorizontal,
|
224 |
| - "Horizontal", |
225 |
| - "padding", |
226 |
| - "")), |
| 220 | + "paddingHorizontal")), |
227 | 221 | hasPaddingVertical(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingVertical : hasValue(
|
228 | 222 | rawProps,
|
229 | 223 | sourceProps.hasPaddingVertical,
|
230 |
| - "Vertical", |
231 |
| - "padding", |
232 |
| - "")), |
| 224 | + "paddingVertical")), |
233 | 225 | hasPaddingLeft(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingLeft : hasValue(
|
234 | 226 | rawProps,
|
235 | 227 | sourceProps.hasPaddingLeft,
|
236 |
| - "Left", |
237 |
| - "padding", |
238 |
| - "")), |
| 228 | + "paddingLeft")), |
239 | 229 | hasPaddingTop(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingTop :
|
240 |
| - hasValue(rawProps, sourceProps.hasPaddingTop, "Top", "padding", "")), |
| 230 | + hasValue(rawProps, sourceProps.hasPaddingTop, "paddingTop")), |
241 | 231 | hasPaddingRight(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingRight : hasValue(
|
242 | 232 | rawProps,
|
243 | 233 | sourceProps.hasPaddingRight,
|
244 |
| - "Right", |
245 |
| - "padding", |
246 |
| - "")), |
| 234 | + "paddingRight")), |
247 | 235 | hasPaddingBottom(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingBottom : hasValue(
|
248 | 236 | rawProps,
|
249 | 237 | sourceProps.hasPaddingBottom,
|
250 |
| - "Bottom", |
251 |
| - "padding", |
252 |
| - "")), |
| 238 | + "paddingBottom")), |
253 | 239 | hasPaddingStart(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingStart : hasValue(
|
254 | 240 | rawProps,
|
255 | 241 | sourceProps.hasPaddingStart,
|
256 |
| - "Start", |
257 |
| - "padding", |
258 |
| - "")), |
| 242 | + "paddingStart")), |
259 | 243 | hasPaddingEnd(CoreFeatures::enablePropIteratorSetter? sourceProps.hasPaddingEnd :
|
260 |
| - hasValue(rawProps, sourceProps.hasPaddingEnd, "End", "padding", "")) { |
| 244 | + hasValue(rawProps, sourceProps.hasPaddingEnd, "paddingEnd")) { |
261 | 245 | }
|
262 | 246 |
|
263 | 247 | void AndroidTextInputProps::setProp(
|
|
0 commit comments