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

[IS-2151] fixed FAB issue #2305

Merged
merged 3 commits into from
Apr 14, 2021

Conversation

aliabbasmalik8
Copy link
Contributor

@aliabbasmalik8 aliabbasmalik8 commented Apr 8, 2021

Details

To fix FAB position on iPad I used keyboardavoidingview for IOS Platform.

Fixed Issues

Fixes https://github.com//issues/2151

Tests

Test on all platform and FAB Icon is shown on the appropriate position and tested with click on FAB ICON and it's working on all platform

QA Steps

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

image

Mobile Web

image

Desktop

image

iPad

image

Android

image

@aliabbasmalik8 aliabbasmalik8 requested a review from a team as a code owner April 8, 2021 19:40
@MelvinBot MelvinBot requested review from Luke9389 and removed request for a team April 8, 2021 19:40
@Luke9389
Copy link
Contributor

Luke9389 commented Apr 8, 2021

Hey @aliabbasmalik8, looks like our linter is pointing out some changes that need to be made. I'll get pinged once you fix those, and then I'll take a look

@aliabbasmalik8
Copy link
Contributor Author

aliabbasmalik8 commented Apr 8, 2021

Hi @Luke9389 lint issues fixed, please have a look

Hey @aliabbasmalik8, looks like our linter is pointing out some changes that need to be made. I'll get pinged once you fix those, and then I'll take a look

@Luke9389
Copy link
Contributor

Luke9389 commented Apr 8, 2021

Hello again @aliabbasmalik8, thanks for that fast turn-around. Something just came up on my end, so I'll have to review this tomorrow.

@Luke9389
Copy link
Contributor

Luke9389 commented Apr 9, 2021

Hello again @aliabbasmalik8, would you please add screenshots for web and mobile web? I see that you've checked the boxes that you tested on those platforms, but screenshots are also required.


function Fab({onPress, isActive}) {
return (
<KeyboardAvoidingView behavior="position">
Copy link
Contributor

Choose a reason for hiding this comment

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

In our documentation, in the Cross Platform 99.999% section, we strongly discourage platform specific code. I understand that the problem is only happening on iOS but this does not mean our solution needs to be iOS specific. Does KeyboardAvoidingView only work on iOS? If not, then we don't need this ios specific file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Luke9389 for android we have no need for KeyboardAvoidingView and we need another configuration for KeyboardAvoidingView if we want to add so that's the reason I moved to platform-specific code.

@@ -3,7 +3,7 @@ import {View} from 'react-native';
import styles from '../../../styles/styles';
import SidebarLinks from './SidebarLinks';
import CreateMenu from '../../../components/CreateMenu';
import FAB from '../../../components/FAB';
import FAB from '../../../components/Fab';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think our preference is to keep FAB as an all caps name to indicate that it's an acronym (Floating Action Button)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated accordingly.

@aliabbasmalik8
Copy link
Contributor Author

Hello again @aliabbasmalik8, would you please add screenshots for web and mobile web? I see that you've checked the boxes that you tested on those platforms, but screenshots are also required.

Added screenshots

src/components/FAB/FAB.js Outdated Show resolved Hide resolved

function Fab({onPress, isActive}) {
return <FAB onPress={onPress} isActive={isActive} />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not following why we can't use the KeyboardAvoidingView everywhere? What is the problem exactly?

Copy link
Contributor Author

@aliabbasmalik8 aliabbasmalik8 Apr 13, 2021

Choose a reason for hiding this comment

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

  1. For android we have no need to use KeyboardAvoidingView
  2. If we want to add KeyboardAvoidingView for android then we need to make many style changes(for both big and small screen) on the SidebarScreen because FAB onPress not working with KeyboardAvoidingView in android. (can fix by making style changes but it's no need so that's the reason not did, will do on demand)

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, I'll take your word for it. Although I'm not sure which style changes you mean in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should add some kind of comment so that we will understand what purpose splitting these files in two serves?


function Fab({onPress, isActive}) {
return <FAB onPress={onPress} isActive={isActive} />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, I'll take your word for it. Although I'm not sure which style changes you mean in this case.


function Fab({onPress, isActive}) {
return <FAB onPress={onPress} isActive={isActive} />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add some kind of comment so that we will understand what purpose splitting these files in two serves?

src/components/FAB/index.js Outdated Show resolved Hide resolved
@marcaaron
Copy link
Contributor

@aliabbasmalik8 please do not force push.

marcaaron
marcaaron previously approved these changes Apr 14, 2021
Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

LGTM

@Luke9389
Copy link
Contributor

Thanks @aliabbasmalik8!

@Luke9389 Luke9389 merged commit e4e0273 into Expensify:master Apr 14, 2021
@OSBotify
Copy link
Contributor

🚀 [Deployed](https://github.com/Expensify/Expensify.cash
/actions/runs/765130740) 🚀 to
staging on Mon Apr 19 2021 at 22:41:56 GMT+0000 (Coordinated Universal Time)

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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.

4 participants