Skip to content

Commit

Permalink
[iOS] Fabric: Fixes Modal present splash when animation type is none
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Dec 8, 2023
1 parent 31005b7 commit 3d6e3eb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
#endif

#if defined(__APPLE__) && TARGET_OS_IOS
#include "ModalHostViewUtils.h"
#endif

namespace facebook::react {

/*
Expand All @@ -25,7 +29,12 @@ class ModalHostViewState final {
public:
using Shared = std::shared_ptr<const ModalHostViewState>;

ModalHostViewState(){};
#if defined(__APPLE__) && TARGET_OS_IOS
ModalHostViewState() : screenSize(RCTModalHostViewScreenSize()) {
#else
ModalHostViewState(){
#endif
};
ModalHostViewState(Size screenSize_) : screenSize(screenSize_){};

#ifdef ANDROID
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#pragma once

#include <react/renderer/core/graphicsConversions.h>

namespace facebook::react {

Size RCTModalHostViewScreenSize(void);

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "ModalHostViewUtils.h"
#import <Foundation/Foundation.h>
#import <React/RCTUtils.h>

namespace facebook::react {

Size RCTModalHostViewScreenSize(void)
{
CGSize screenSize = RCTScreenSize();
return {screenSize.width, screenSize.height};
}

} // namespace facebook::react

0 comments on commit 3d6e3eb

Please sign in to comment.