mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Move toDynamic conversion for BoxShadow (#52536)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52536 See title Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D78005880 fbshipit-source-id: 5a4b7ff3c4d9c6ece17759926ee80aec80d3cde0
This commit is contained in:
1 parent
263ccad3c5
commit
0144798e25
2 files changed
+20
-15
No files matched your search
-15
@@ -491,21 +491,6 @@ inline static void updateAccessibilityStateProp(
|
||||
result["accessibilityState"] = resultState;
|
||||
}
|
||||
|
||||
static folly::dynamic toDynamic(const std::vector<BoxShadow>& boxShadow) {
|
||||
folly::dynamic boxShadowResult = folly::dynamic::array();
|
||||
for (const auto& boxShadowValue : boxShadow) {
|
||||
folly::dynamic boxShadowValueResult = folly::dynamic::object();
|
||||
boxShadowValueResult["offsetX"] = boxShadowValue.offsetX;
|
||||
boxShadowValueResult["offsetY"] = boxShadowValue.offsetY;
|
||||
boxShadowValueResult["blurRadius"] = boxShadowValue.blurRadius;
|
||||
boxShadowValueResult["spreadDistance"] = boxShadowValue.spreadDistance;
|
||||
boxShadowValueResult["color"] = *boxShadowValue.color;
|
||||
boxShadowValueResult["inset"] = boxShadowValue.inset;
|
||||
boxShadowResult.push_back(boxShadowValueResult);
|
||||
}
|
||||
return boxShadowResult;
|
||||
}
|
||||
|
||||
static folly::dynamic toDynamic(const std::vector<FilterFunction>& filter) {
|
||||
folly::dynamic filterResult = folly::dynamic::array();
|
||||
for (const auto& filterFunction : filter) {
|
||||
|
||||
@@ -21,5 +21,25 @@ struct BoxShadow {
|
||||
Float spreadDistance{};
|
||||
SharedColor color{};
|
||||
bool inset{};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
folly::dynamic toDynamic() const {
|
||||
folly::dynamic result = folly::dynamic::object();
|
||||
result["offsetX"] = offsetX;
|
||||
result["offsetY"] = offsetY;
|
||||
result["blurRadius"] = blurRadius;
|
||||
result["spreadDistance"] = spreadDistance;
|
||||
result["color"] = *color;
|
||||
result["inset"] = inset;
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
inline folly::dynamic toDynamic(const BoxShadow& boxShadow) {
|
||||
return boxShadow.toDynamic();
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace facebook::react
|
||||
Reference in new issue
Block a user