Add <Modal /> component

Summary:
Create Modal component that can be used to present content modally.
This commit is contained in:
Alex Akers
2015-07-28 07:31:26 -07:00
parent f53c95c743
commit 7d19ff3dcb
14 changed files with 359 additions and 8 deletions

View File

@@ -40,10 +40,10 @@
- (UIView *)viewForReactTag:(NSNumber *)reactTag;
/**
* Update the frame of a root view. This might be in response to a screen rotation
* Update the frame of a view. This might be in response to a screen rotation
* or some other layout event outside of the React-managed view hierarchy.
*/
- (void)setFrame:(CGRect)frame forRootView:(UIView *)rootView;
- (void)setFrame:(CGRect)frame forView:(UIView *)view;
/**
* Update the background color of a root view. This is usually triggered by

View File

@@ -368,13 +368,11 @@ static NSDictionary *RCTViewConfigForModule(Class managerClass)
return _viewRegistry[reactTag];
}
- (void)setFrame:(CGRect)frame forRootView:(UIView *)rootView
- (void)setFrame:(CGRect)frame forView:(UIView *)view
{
RCTAssertMainThread();
NSNumber *reactTag = rootView.reactTag;
RCTAssert(RCTIsReactRootView(reactTag), @"Specified view %@ is not a root view", reactTag);
NSNumber *reactTag = view.reactTag;
dispatch_async(_shadowQueue, ^{
RCTShadowView *rootShadowView = _shadowViewRegistry[reactTag];
RCTAssert(rootShadowView != nil, @"Could not locate root view with tag #%@", reactTag);