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

feat: Screen props: Window traits (2) #1363

Merged
merged 38 commits into from
Apr 1, 2022
Merged

Conversation

@kkafar kkafar changed the title feat: Screen props: statusBar* feat: Screen props: statusBar* (2) Mar 18, 2022
@kkafar kkafar requested a review from WoLewicki March 18, 2022 12:29
Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🎉 I added some comments. Could you also expand FabricExample so the newly added props are available to be tested there? Maybe something similar to Example, where we have screens for different kinds of props.

TestsExample/ios/Podfile.lock Outdated Show resolved Hide resolved
ios/RNSEnums.h Outdated Show resolved Hide resolved
@@ -378,6 +378,8 @@ - (void)invalidate

@end

#pragma mark - RNSScreen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for ease of navigation in file with implementations of 2+ classes, should I remove it?

ios/RNSScreenComponentView.h Outdated Show resolved Hide resolved
@@ -31,6 +32,13 @@ - (instancetype)initWithFrame:(CGRect)frame
static const auto defaultProps = std::make_shared<const RNSScreenProps>();
_props = defaultProps;
_controller = [[RNSScreenController alloc] initWithView:self];
// TODO: use default props (?)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can leave just _gestureEnabled

@@ -194,10 +241,31 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
const auto &oldScreenProps = *std::static_pointer_cast<const RNSScreenProps>(_props);
const auto &newScreenProps = *std::static_pointer_cast<const RNSScreenProps>(props);

[super updateProps:props oldProps:oldProps];
[self setFullScreenSwipeEnabled:newScreenProps.fullScreenSwipeEnabled];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you sometimes just set the new prop and sometimes you check the old ones before setting new one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The props surrounded with if-statement have some additional logic in their setters, no reason to run it when the prop value is not changed.

ios/RNSScreenWindowTraits.m Outdated Show resolved Hide resolved
src/fabric/ScreenNativeComponent.js Show resolved Hide resolved
@kkafar kkafar marked this pull request as ready for review March 22, 2022 13:19
@kkafar kkafar force-pushed the @kkafar/screen-props-fullScreenSwipeEnabled branch from ae55c29 to 92c1eef Compare March 25, 2022 14:36
This allows to share those types between old and new architecture
Required to enable status bar modifications
@kkafar kkafar force-pushed the @kkafar/screen-props-statusBar branch from 38a6ed2 to 310339c Compare March 25, 2022 14:53
@kkafar kkafar changed the title feat: Screen props: statusBar* (2) feat: Screen props: Window traits (2) Mar 31, 2022
@kkafar kkafar force-pushed the @kkafar/screen-props-statusBar branch from a6cca1d to 9438df7 Compare March 31, 2022 08:15
@kkafar kkafar force-pushed the @kkafar/screen-props-fullScreenSwipeEnabled branch from 92c1eef to a8019a8 Compare March 31, 2022 13:42
Base automatically changed from @kkafar/screen-props-fullScreenSwipeEnabled to main April 1, 2022 09:37
@kkafar kkafar requested a review from WoLewicki April 1, 2022 10:26
@kkafar kkafar merged commit 942524b into main Apr 1, 2022
@kkafar kkafar deleted the @kkafar/screen-props-statusBar branch April 1, 2022 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants