-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix/46488 fix modal centering #46860
Fix/46488 fix modal centering #46860
Conversation
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
import colors from '@styles/theme/colors'; | ||
import CONST from '@src/CONST'; | ||
|
||
const HEADER_HEIGHT = 80; | ||
const BUTTON_HEIGHT = 40; | ||
const BUTTON_MARGIN = 12; | ||
|
||
const isIOSNative = getPlatform() === CONST.PLATFORM.IOS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using getPlatform in our App
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 we should refactor into platform specific files
function EmptyCardView() { | ||
const {translate} = useLocalize(); | ||
const styles = useThemeStyles(); | ||
const {windowHeight, isSmallScreenWidth} = useWindowDimensions(); | ||
|
||
const headerHeight = isSmallScreenWidth ? HEADER_HEIGHT + BUTTON_HEIGHT + BUTTON_MARGIN : HEADER_HEIGHT; | ||
const safeAreaInsets = useSafeAreaInsets(); | ||
const headerHeight = isSmallScreenWidth ? HEADER_HEIGHT + BUTTON_HEIGHT + BUTTON_MARGIN + (isIOSNative ? safeAreaInsets.top : 0) : HEADER_HEIGHT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koko57 We should create a function to get headerHeight
and incorporating specific logic for each platform determined by the file name. See getPlaidLinkTokenParameters function as an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're using getPlatform in ComposerWithSuggestions, so why not use it here? For ios it would need to be a hook, not a regular function or we would need to pass safeAreaInsets as a param to the function and would need to ignore it for web/android implementation? I think it's unnecessary complication as we have getPlatform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koko57 It isn't recommended in our codebase. Please see this guideline
3. Platform-specific files should follow the proper naming convention (see [Platform-Specific File Extensions](https://github.com/expensify/app#platform-specific-file-extensions)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koko57 Any update here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DylanDylann I don't see using getPlatform is discouraged, only a proper naming is mentioned. I think in this case we don't need platform specific function as it creates more unnecessary complexity.
curious wdyt @mountiny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koko57 I am with @DylanDylann we should create platform specific files and that is the best practice even if its.a bit more boilerplate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with Dylan
ok, done |
@DylanDylann ready for review |
@koko57 Also please check this comment: #45690 (comment) |
@mountiny The UI looks good to me. Do we need to build ad-hoc and request a review from the design team? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-09.at.11.46.56.movAndroid: mWeb ChromeScreen.Recording.2024-08-09.at.11.36.43.moviOS: NativeScreen.Recording.2024-08-09.at.11.47.17.moviOS: mWeb SafariScreen.Recording.2024-08-09.at.11.35.47.movMacOS: Chrome / SafariScreen.Recording.2024-08-09.at.11.34.40.movMacOS: DesktopScreen.Recording.2024-08-09.at.11.24.38.mov |
@Expensify/design Just before merging this PR, do you want to leave this a review? there are screenshots of how this looks in the PR checklist. Thanks! |
Screenshots seem to look good to me. I would love a screen recording of someone changing their screen size to make sure it's still all good and responsive. |
@shawnborton here's the recording 🙂 |
That looks great! |
@mountiny All yours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks everyone!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
FYI I believe this was deployed to prod yesterday, from this checklist - #47219 |
Details
Fixed Issues
$ #46488
PROPOSAL: -
Tests
PREREQUISITES: you need to have all betas / workspaceFeeds beta enabled
Offline tests
QA Steps
PREREQUISITES: you need to have all betas / workspaceFeeds beta enabled
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop