Open
Conversation
trm217
reviewed
Aug 13, 2024
Comment on lines
+13
to
+26
| (W_WIDTH === 375 && W_HEIGHT === 812) || | ||
| (W_WIDTH === 414 && W_HEIGHT === 896) | ||
| ) { | ||
| isIPhoneWithMonobrow_v = true | ||
| statusBarHeight = 44 | ||
| } else if ( | ||
| (W_WIDTH === 390 && W_HEIGHT === 844) || | ||
| (W_WIDTH === 428 && W_HEIGHT === 926) | ||
| ) { | ||
| isIPhoneWithMonobrow_v = true | ||
| statusBarHeight = 47 | ||
| } else if ( | ||
| (W_WIDTH === 393 && W_HEIGHT === 932) || | ||
| (W_WIDTH === 393 && W_HEIGHT === 852) |
Contributor
There was a problem hiding this comment.
I would probably keep the constant from the index.js used in react-native-status-bar-height. Magic Numbers with no description are quite confusing, especially in the long run. (Alternativelay, on could comment the cases to give context to what devices are checked in each case).
The constants defined in the lib:
const STATUSBAR_DEFAULT_HEIGHT = 20;
const STATUSBAR_X_HEIGHT = 44;
const STATUSBAR_IP12_HEIGHT = 47;
const STATUSBAR_IP12MAX_HEIGHT = 47;
const STATUSBAR_IP14PRO_HEIGHT = 54;
const X_WIDTH = 375;
const X_HEIGHT = 812;
const XSMAX_WIDTH = 414;
const XSMAX_HEIGHT = 896;
const IP12_WIDTH = 390;
const IP12_HEIGHT = 844;
const IP12MAX_WIDTH = 428;
const IP12MAX_HEIGHT = 926;
const IP14PRO_WIDTH = 393;
const IP14PRO_HEIGHT = 852;
const IP14PROMAX_WIDTH = 430;
const IP14PROMAX_HEIGHT = 932;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For Reference, here's the index.js from react-native-statusbar-height package: