-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: Add more space to bottom docked button #44761
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
@allgandalf 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] |
This comment has been minimized.
This comment has been minimized.
Screen.Recording.2024-07-03.at.15.59.10.mov |
I think we should add the padding there for consistency. And we should check as many other pages as we can too to make sure we aren't missing any.
Much better! |
src/components/Form/FormWrapper.tsx
Outdated
useEffect(() => { | ||
const keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', () => { |
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.
What does this useEffect
do exactly?
@allgandalf I updated PR. Now, I use the additional padding bottom style in
|
I will review this today |
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.
also are we covering all the cases with these changes?
Yes |
|
||
const useExtraSafePaddingBottomStyle = () => { | ||
const styles = useThemeStyles(); | ||
const [willKeyboardShow, setWillKeyboardShow] = useState(false); |
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.
Can you typecast the boolean type of the variable and also rename the variable to something more readable like:
isKeyboardVisible
?
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.
I added the type for it. But I don't think we should rename the state, because as I mentioned above, willKeyboardShow
is used to fix the issue didKeyboardShow
encountered: There is a delay when the keyboard is visible by the user and the when didKeyboardShow
is set to true
. So it is not just isKeyboardVisible
.
Yeah, that looks better. Can you help me understand why the two of them are different though? |
We use App/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx Lines 140 to 145 in 0d70442
And screenwrapper for the display name page: App/src/pages/settings/Profile/DisplayNamePage.tsx Lines 72 to 77 in 0d70442
|
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.
changes LGTM, looks good to be merged into staging
Got it. Yeah, ideally we use whatever is consistent with other places (like display name). How do you recommend we fix that? |
Use screenwrapper instead of |
Sounds good! |
@Expensify/design someone mind reviewing as well? |
Oh whoops, my bad. I see @shawnborton already reviewed above. |
@puneetlath I addressed your comment above |
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.
Sorry a couple more small requests.
import useStyledSafeAreaInsets from './useStyledSafeAreaInsets'; | ||
import useThemeStyles from './useThemeStyles'; | ||
|
||
const useSafePaddingBottomStyle = () => { |
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.
Can we add some general documentation above about what this hook is for.
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.
Sorry for being a stickler, but I'm finding this comment a bit hard to follow. In the future, when should someone use this hook? Maybe if you can just explain that to me in words in a comment here, I can help you craft a code comment that is a bit more clear.
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.
agree with you @puneetlath , @truph01 can you please follow up with this
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.
In the future, when should someone use this hook
This hook, useSafePaddingBottomStyle, is useful for adding extra bottom padding to a component based on the device's safe area. If the device's safe area padding bottom is 0, the hook returns 0. Otherwise, it provides a padding bottom of 20. Use this to ensure content visibility and layout consistency across different devices.
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.
That's beautiful. Very clear! Let's make that the comment.
All comment are resolved |
import useStyledSafeAreaInsets from './useStyledSafeAreaInsets'; | ||
import useThemeStyles from './useThemeStyles'; | ||
|
||
const useSafePaddingBottomStyle = () => { |
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.
Sorry for being a stickler, but I'm finding this comment a bit hard to follow. In the future, when should someone use this hook? Maybe if you can just explain that to me in words in a comment here, I can help you craft a code comment that is a bit more clear.
Co-authored-by: Puneet Lath <[email protected]>
I updated PR @puneetlath |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/puneetlath in version: 9.0.13-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.13-4 🚀
|
Details
Fixed Issues
$ #44056
PROPOSAL: #44056 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
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