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

button styling fixed #3193

Merged
merged 10 commits into from
Jun 11, 2021
Merged

button styling fixed #3193

merged 10 commits into from
Jun 11, 2021

Conversation

parasharrajat
Copy link
Member

@parasharrajat parasharrajat commented May 27, 2021

Details

  • -> Profile page
  • -> Password Page
  • -> Payments page
  • -> New group Page
  • -> Add Secondary login
  • -> IOU -> Request Money Page.
  • -> IOU -> Currency Selection Page
  • -> IOU -> Request Money -> Confirm Page
  • -> IOU -> Split Money -> Confirm Page
  • -> IOU -> Split Money -> Participant Page

Fixed Issues

Fixes #3055

Tests | QA Steps

1.Open E.cash on Android and IOS.
2. Check all the above listed Pages.
3. Fixed Button button(if any) should always float over the keyboard.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

button.mp4

Android

output.mp4

@parasharrajat parasharrajat requested a review from a team as a code owner May 27, 2021 21:28
@MelvinBot MelvinBot requested review from Dal-Papa and removed request for a team May 27, 2021 21:29
@parasharrajat parasharrajat changed the title button styling fixed [WIP] button styling fixed May 27, 2021
@parasharrajat parasharrajat marked this pull request as draft May 27, 2021 21:31
@parasharrajat parasharrajat marked this pull request as ready for review June 2, 2021 03:05
@parasharrajat
Copy link
Member Author

Requesting review @shawnborton

@parasharrajat parasharrajat changed the title [WIP] button styling fixed button styling fixed Jun 2, 2021
Copy link

@Dal-Papa Dal-Papa left a comment

Choose a reason for hiding this comment

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

Apart from my comment about i18n, this looks ok to me but I'd love @marcaaron's opinion on it.

style={[styles.textInput]}
value={this.state.searchValue}
onChangeText={this.changeSearchValue}
placeholder="Search"
Copy link

Choose a reason for hiding this comment

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

Shouldn't this get translated too ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it should be. But It does not come under the scope of this PR. Anyways happy to do this change. Let me know, if I should do this change as well.

Copy link

Choose a reason for hiding this comment

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

Could you please add it ? That way we don't forget about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Pushing a commit right away.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Dal-Papa Code pushed. Thanks.

@Dal-Papa Dal-Papa requested a review from marcaaron June 2, 2021 20:29
@shawnborton
Copy link
Contributor

This looks good to me! I think we should standardize on the button styles for disabled buttons though. My thinking is that a disabled button should be 50% transparent, giving us something like this:
image

Thoughts?

@parasharrajat
Copy link
Member Author

I am not sure about it. It totally depends on the Branding. I think we should raise this point on the Slack. @shawnborton

@shawnborton
Copy link
Contributor

Well that is indeed the branding that we have designed, it just hasn't been implemented correctly. But I understand that this isn't technically part of the work we asked you to do, so we can open up a separate issue to address the button inconsistencies.

@michaelhaxhiu
Copy link
Contributor

@shawnborton feel free to drop a comment in #expensify-open-source by saying something like ISSUE: standardize button styles and we can run it through the standard process to get it assigned!

@parasharrajat
Copy link
Member Author

Updated. Marc is on leave till Monday. Maybe we can have it reviewed by someone else. Thanks.

@Dal-Papa
Copy link

Dal-Papa commented Jun 4, 2021

@roryabraham mind giving this a quick look to be safe please ? 🙏

@Dal-Papa Dal-Papa requested review from roryabraham and removed request for marcaaron June 4, 2021 18:29
Dal-Papa
Dal-Papa previously approved these changes Jun 4, 2021
Copy link

@Dal-Papa Dal-Papa left a comment

Choose a reason for hiding this comment

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

LGTM

@parasharrajat
Copy link
Member Author

@roryabraham Are we good here? Thanks.

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

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

Left a few notes but overall looks good

src/components/FixedFooter.js Outdated Show resolved Hide resolved
src/libs/KeyboardAvoidingView/index.js Show resolved Hide resolved
@parasharrajat
Copy link
Member Author

@Jag96 Done.

@roryabraham
Copy link
Contributor

I think we should standardize on the button styles for disabled buttons though. My thinking is that a disabled button should be 50% transparent, giving us something like this

Agree, but in addition we should standardize on a cursor: not-allowed style when hovering over any disabled button:

image

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Overall this PR leaves me wondering if we can make some reusable components to make some of this stuff easier in the future, something like this (in psuedocode):

const ViewWithFixedButtonFooter = props => (
    <>
        <ScrollView style={[styles.flex1, styles.w100]}>
            {this.props.children}
        </ScrollView>
        {this.props.shouldShowButton && (
            <FixedFooter>
                <Button
                    success={this.props.buttonSuccess}
                    onPress={this.props.onButtonPressed}
                    style={styles.w100}
                    text={this.props.buttonText}
                />
            </FixedFooter>
        )}
    </>
)

const PageWithFixedButtonFooter = props => (
    <ScreenWrapper>
        {({didScreenTransitionEnd}) => (
            <>
                <FullScreenLoadingIndicator visible={!didScreenTransitionEnd} />
                {didScreenTransitionEnd && (
                    <KeyboardAvoidingView>
                        {this.props.shouldShowHeader && (
                            <HeaderWithCloseButton />
                        )}
                        <ViewWithFixedButtonFooter>
                            {this.props.children}
                        </ViewWithFixedButtonFooter />
                    </KeyboardAvoidingView>
                )}
            </>
        )}
    </ScreenWrapper>
)

selectedAmount={this.state.amount}
navigation={this.props.navigation}
/>
<IOUAmountPage
Copy link
Contributor

Choose a reason for hiding this comment

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

All this indentation was correct, can we reset this back the way it was?

@parasharrajat
Copy link
Member Author

Yeah. It does look that a component can be extracted but I don't think it would be that much value as it seems. Let me have a close look at it to see if we have a pattern here.

@michaelhaxhiu
Copy link
Contributor

👋 heyo - is this on track to merge today?

@parasharrajat
Copy link
Member Author

I am looking into extracting the code into common components but I feel like it requires some amount of time to carefully replace all the components. I can put a follow-up PR and I think we should merge this as it is working as it should be. But it's your call.

@michaelhaxhiu
Copy link
Contributor

@parasharrajat thanks for the context. Let's have @roryabraham weigh in if he didn't already before making a decision.

But my 2 cents is we could decide this based on scope. If the addition you are describing is going to inflate scope significantly, my vote is to open a new PR. But if it's a part of the current scope then I agree with holding and keeping it contained in 1 PR for simplicity.

@roryabraham
Copy link
Contributor

Sorry for the delay here @parasharrajat, if you resolve the merge conflicts, retest, and it's all still working then I'd feel okay approving/merging.

In my experience, all this stuff with KeyboardAvoidingView, ScrollView, and now FixedFooter is always pretty challenging to get right on all different devices. It seems like you've done a good job getting everything working (which is what we hired you for 😁 ), so we can merge this! But it would be more valuable if we could extract some reusable components from this to make the pattern easier to repeat and get right in the future. Just :my_two_cents:

@parasharrajat
Copy link
Member Author

@roryabraham I agree with the point to extract common components but currently, I feel a little overwhelmed. I would definitely look into abstracting them. I have updated the PR and let me know what would be the best step ahead.

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

No worries @parasharrajat! I'm sure you've got higher-priority stuff that you're assigned, and this is working. Let's just move on and work on new features and bug fixes. Maybe we can circle back on this if a similar issue arises in the future 😄

@roryabraham roryabraham merged commit c5e6da2 into Expensify:main Jun 11, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.68-5🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.73-3🚀

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.

Make button styles consistent in Expensify.cash
7 participants