From b10278638c62d886e936fe4f97aaaef88c24a69c Mon Sep 17 00:00:00 2001 From: Tatiana Kapos Date: Tue, 13 Aug 2024 18:16:59 -0700 Subject: [PATCH] [0.75] Backport Enforce StatusBarManger module aligns with Spec #13556 (#13568) * backport Enforce StatusBarManger module aligns with Spec #13556 * Change files --- ...-d6d68656-5e3d-4020-9cd6-703ed3f87bfa.json | 7 ++++++ .../Modules/StatusBarManager.h | 23 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 change/react-native-windows-d6d68656-5e3d-4020-9cd6-703ed3f87bfa.json diff --git a/change/react-native-windows-d6d68656-5e3d-4020-9cd6-703ed3f87bfa.json b/change/react-native-windows-d6d68656-5e3d-4020-9cd6-703ed3f87bfa.json new file mode 100644 index 00000000000..06d5e0c4423 --- /dev/null +++ b/change/react-native-windows-d6d68656-5e3d-4020-9cd6-703ed3f87bfa.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "backport Enforce StatusBarManger module aligns with Spec #13556", + "packageName": "react-native-windows", + "email": "tatianakapos@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative/Modules/StatusBarManager.h b/vnext/Microsoft.ReactNative/Modules/StatusBarManager.h index 53c3018ae6b..eca1b9a5b04 100644 --- a/vnext/Microsoft.ReactNative/Modules/StatusBarManager.h +++ b/vnext/Microsoft.ReactNative/Modules/StatusBarManager.h @@ -4,9 +4,30 @@ #include +#include "codegen/NativeStatusBarManagerAndroidSpec.g.h" + namespace Microsoft::ReactNative { REACT_MODULE(StatusBarManager) -struct StatusBarManager {}; +struct StatusBarManager { + using ModuleSpec = Microsoft::ReactNativeSpecs::StatusBarManagerAndroidSpec; + + REACT_GET_CONSTANTS(GetConstants) + static Microsoft::ReactNativeSpecs::StatusBarManagerAndroidSpec_Constants GetConstants() noexcept { + return {0}; + } + + REACT_METHOD(setColor) + static void setColor(double /*color*/, bool /*animated*/) noexcept {} + + REACT_METHOD(setTranslucent) + static void setTranslucent(bool /*translucent*/) noexcept {} + + REACT_METHOD(setStyle) + static void setStyle(std::optional /*statusBarStyle*/) noexcept {} + + REACT_METHOD(setHidden) + static void setHidden(bool /*hidden*/) noexcept {} +}; } // namespace Microsoft::ReactNative