Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[menu-bar] Migrate MenuBar to Expo Modules #133

Merged
merged 9 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

- Install the expo package and set up autolinking for macOS. ([#130](https://github.com/expo/orbit/pull/130) by [@tsapeta](https://github.com/tsapeta))
- Remove AsyncStorage migrator and @react-native-async-storage/async-storage dependency. ([#135](https://github.com/expo/orbit/pull/135) by [@gabrieldonadel](https://github.com/gabrieldonadel))
- Migrate Menubar to expo modules.([#133](https://github.com/expo/orbit/pull/133) by [@alanhughes](https://github.com/alanjhughes))

## 1.0.2 — 2024-01-17

Expand Down
13 changes: 13 additions & 0 deletions apps/menu-bar/macos/ExpoMenuBar-macOS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
popover.contentSize = NSMakeSize(380, 450);
popover.contentViewController = rootViewController;
popover.behavior = NSPopoverBehaviorTransient;
[self addPopoverObservers];

#ifdef SHOW_DEV_WINDOW
#if RCT_DEV
Expand Down Expand Up @@ -125,6 +126,18 @@ - (void)setPopoverContentSize:(NSSize)size {
[popover.contentViewController.view setFrameSize:size];
}

- (void)addPopoverObservers {
NSNotificationCenter *notificationCenter = NSNotificationCenter.defaultCenter;
__weak typeof(self) weakSelf = self;

[notificationCenter addObserverForName:@"ExpoOrbit_OpenPopover" object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) {
[weakSelf openPopover];
}];
[notificationCenter addObserverForName:@"ExpoOrbit_ClosePopover" object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) {
[weakSelf closePopover];
}];
}

- (void)onPressStatusItem:(id)sender {
NSEvent *event = [NSApp currentEvent];
if (event.type == NSEventTypeRightMouseUp) {
Expand Down
5 changes: 0 additions & 5 deletions apps/menu-bar/macos/ExpoMenuBar-macOS/MenuBarModule.h

This file was deleted.

271 changes: 0 additions & 271 deletions apps/menu-bar/macos/ExpoMenuBar-macOS/MenuBarModule.m

This file was deleted.

12 changes: 4 additions & 8 deletions apps/menu-bar/macos/ExpoMenuBar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
C0B36EA22A65E25A004F2D8C /* Checkbox.m in Sources */ = {isa = PBXBuildFile; fileRef = C0B36E9F2A65E25A004F2D8C /* Checkbox.m */; };
C0B36EA32A65E25A004F2D8C /* CheckboxManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C0B36EA12A65E25A004F2D8C /* CheckboxManager.m */; };
C0C820022AB8E5EE003D75AF /* SparkleModule.m in Sources */ = {isa = PBXBuildFile; fileRef = C0C820012AB8E5EE003D75AF /* SparkleModule.m */; };
C0E7CF482A15378D00C59DE5 /* MenuBarModule.m in Sources */ = {isa = PBXBuildFile; fileRef = C0E7CF472A15378D00C59DE5 /* MenuBarModule.m */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -118,8 +117,6 @@
C0B36EA12A65E25A004F2D8C /* CheckboxManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckboxManager.m; sourceTree = "<group>"; };
C0C820012AB8E5EE003D75AF /* SparkleModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SparkleModule.m; sourceTree = "<group>"; };
C0C820032AB8E600003D75AF /* SparkleModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SparkleModule.h; sourceTree = "<group>"; };
C0E7CF462A15372D00C59DE5 /* MenuBarModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MenuBarModule.h; sourceTree = "<group>"; };
C0E7CF472A15378D00C59DE5 /* MenuBarModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MenuBarModule.m; sourceTree = "<group>"; };
CE0E74F571E1F48FF00A8324 /* Pods-Shared-ExpoMenuBar-macOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Shared-ExpoMenuBar-macOS.release.xcconfig"; path = "Target Support Files/Pods-Shared-ExpoMenuBar-macOS/Pods-Shared-ExpoMenuBar-macOS.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
Expand Down Expand Up @@ -192,8 +189,6 @@
514201562437B4B40078DB4F /* Info.plist */,
514201572437B4B40078DB4F /* main.m */,
514201592437B4B40078DB4F /* ExpoMenuBar.entitlements */,
C0E7CF462A15372D00C59DE5 /* MenuBarModule.h */,
C0E7CF472A15378D00C59DE5 /* MenuBarModule.m */,
C061C79D2A251E0C00A53D8D /* DevViewController.m */,
C061C79F2A251E3500A53D8D /* DevViewController.h */,
C061C7A02A26B21C00A53D8D /* AutoResizerRootViewManager.m */,
Expand Down Expand Up @@ -525,7 +520,6 @@
C0271C582A602CDE0065AB11 /* ProgressIndicatorManager.m in Sources */,
C0B36EA32A65E25A004F2D8C /* CheckboxManager.m in Sources */,
C0C820022AB8E5EE003D75AF /* SparkleModule.m in Sources */,
C0E7CF482A15378D00C59DE5 /* MenuBarModule.m in Sources */,
C06B8F8D2AAA9058009F2BB5 /* FileHandlerManager.m in Sources */,
C0271C5B2A602FF60065AB11 /* ProgressIndicatorView.m in Sources */,
C051EC0E2AA227C600C6D615 /* SwifterWrapper.swift in Sources */,
Expand Down Expand Up @@ -708,7 +702,8 @@
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl -ld_classic ",
"-Wl",
"-ld_classic",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native-macos";
SDKROOT = macosx;
Expand Down Expand Up @@ -775,7 +770,8 @@
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl -ld_classic ",
"-Wl",
"-ld_classic",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native-macos";
SDKROOT = macosx;
Expand Down
Loading