-
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 styles for MoneyRequestHeader #18467
Conversation
@rushatgabhane @Beamanator One of you needs to 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] |
@yuwenmemon should I review 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.
LGTM!
No worries @rushatgabhane . I can do that now. it is a follow-up PR. |
@rushatgabhane @parasharrajat coming from this post, this is an EC3 issue so whoever can review first should do it. |
seems like @parasharrajat is on it now |
I am suggesting a few style change that looks better to me. Sorry, I could do that on the original PR because I was trying to figure out the testing. Here is the diff of suggested changes. IMO, the flex1 should be applied to AvatarWithDisplayName container and no wrapper should be applied to HeaderWithcloseButton. This will keepHeaderWithcloseButton more flexible for future. diff --git a/src/components/AvatarWithDisplayName.js b/src/components/AvatarWithDisplayName.js
index dfee2ca605..cb56b27b48 100644
--- a/src/components/AvatarWithDisplayName.js
+++ b/src/components/AvatarWithDisplayName.js
@@ -51,59 +51,57 @@ const AvatarWithDisplayName = (props) => {
const ownerPersonalDetails = OptionsListUtils.getPersonalDetailsForLogins([props.report.ownerEmail], props.personalDetails);
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(ownerPersonalDetails, false);
return (
- <View>
- <View style={[styles.appContentHeaderTitle]}>
- {Boolean(props.report && title) && (
- <View
+ <View style={[styles.appContentHeaderTitle, styles.flex1]}>
+ {Boolean(props.report && title) && (
+ <View
+ style={[
+ styles.flexRow,
+ styles.alignItemsCenter,
+ styles.justifyContentBetween,
+ ]}
+ >
+ {isExpenseReport ? (
+ <SubscriptAvatar
+ mainAvatar={icons[0]}
+ secondaryAvatar={icons[1]}
+ mainTooltip={props.report.ownerEmail}
+ secondaryTooltip={subtitle}
+ size={props.size}
+ />
+ ) : (
+ <Avatar
+ size={props.size}
+ source={icons[0].source}
+ type={icons[0].type}
+ name={icons[0].name}
+ containerStyles={props.size === CONST.AVATAR_SIZE.SMALL ? styles.emptyAvatarSmall : styles.emptyAvatar}
+ />
+ )}
+ <View style={[styles.flex1, styles.flexColumn, styles.ml3]}>
+ <DisplayNames
+ fullTitle={title}
+ displayNamesWithTooltips={displayNamesWithTooltips}
+ tooltipEnabled
+ numberOfLines={1}
+ textStyles={[styles.headerText, styles.pre]}
+ shouldUseFullTitle={isExpenseReport}
+ />
+ {!_.isEmpty(subtitle) && (
+ <Text
style={[
- styles.flexRow,
- styles.alignItemsCenter,
- styles.justifyContentBetween,
+ styles.sidebarLinkText,
+ styles.optionAlternateText,
+ styles.textLabelSupporting,
+ styles.pre,
]}
+ numberOfLines={1}
>
- {isExpenseReport ? (
- <SubscriptAvatar
- mainAvatar={icons[0]}
- secondaryAvatar={icons[1]}
- mainTooltip={props.report.ownerEmail}
- secondaryTooltip={subtitle}
- size={props.size}
- />
- ) : (
- <Avatar
- size={props.size}
- source={icons[0].source}
- type={icons[0].type}
- name={icons[0].name}
- containerStyles={props.size === CONST.AVATAR_SIZE.SMALL ? styles.emptyAvatarSmall : styles.emptyAvatar}
- />
- )}
- <View style={[styles.flex1, styles.flexColumn, styles.ml3]}>
- <DisplayNames
- fullTitle={title}
- displayNamesWithTooltips={displayNamesWithTooltips}
- tooltipEnabled
- numberOfLines={1}
- textStyles={[styles.headerText, styles.pre]}
- shouldUseFullTitle={isExpenseReport}
- />
- {!_.isEmpty(subtitle) && (
- <Text
- style={[
- styles.sidebarLinkText,
- styles.optionAlternateText,
- styles.textLabelSupporting,
- styles.pre,
- ]}
- numberOfLines={1}
- >
- {subtitle}
- </Text>
- )}
- </View>
- </View>
- )}
+ {subtitle}
+ </Text>
+ )}
+ </View>
</View>
+ )}
</View>
);
};
diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js
index 6b012a3ee0..0ec4726558 100755
--- a/src/components/HeaderWithCloseButton.js
+++ b/src/components/HeaderWithCloseButton.js
@@ -165,30 +165,28 @@ class HeaderWithCloseButton extends Component {
styles.overflowHidden,
]}
>
- <View style={[styles.flexRow, this.props.shouldShowAvatarWithDisplay && styles.flex1]}>
- {this.props.shouldShowBackButton && (
- <Tooltip text={this.props.translate('common.back')}>
- <Pressable
- onPress={() => {
- if (this.props.isKeyboardShown) {
- Keyboard.dismiss();
- }
- this.props.onBackButtonPress();
- }}
- style={[styles.touchableButtonImage]}
- >
- <Icon src={Expensicons.BackArrow} />
- </Pressable>
- </Tooltip>
- )}
- {this.props.shouldShowAvatarWithDisplay && (
- <AvatarWithDisplayName
- report={this.props.report}
- policies={this.props.policies}
- personalDetails={this.props.personalDetails}
- />
- )}
- </View>
+ {this.props.shouldShowBackButton && (
+ <Tooltip text={this.props.translate('common.back')}>
+ <Pressable
+ onPress={() => {
+ if (this.props.isKeyboardShown) {
+ Keyboard.dismiss();
+ }
+ this.props.onBackButtonPress();
+ }}
+ style={[styles.touchableButtonImage]}
+ >
+ <Icon src={Expensicons.BackArrow} />
+ </Pressable>
+ </Tooltip>
+ )}
+ {this.props.shouldShowAvatarWithDisplay && (
+ <AvatarWithDisplayName
+ report={this.props.report}
+ policies={this.props.policies}
+ personalDetails={this.props.personalDetails}
+ />
+ )}
{!this.props.shouldShowAvatarWithDisplay && (
<Header
title={this.props.title} |
More changes, we should remove the containerStyles from the HeaderWithCloseButton in MoneyRequestHeader. diff --git a/src/components/MoneyRequestHeader.js b/src/components/MoneyRequestHeader.js
index 728ff0a227..df09048c6a 100644
--- a/src/components/MoneyRequestHeader.js
+++ b/src/components/MoneyRequestHeader.js
@@ -73,7 +73,6 @@ const MoneyRequestHeader = (props) => {
report={props.report}
policies={props.policies}
personalDetails={props.personalDetails}
- containerStyles={[styles.pt5, styles.pb3, styles.pr1]}
shouldShowCloseButton={false}
shouldShowBackButton={props.isSmallScreenWidth}
onBackButtonPress={() => Navigation.navigate(ROUTES.HOME)} |
Doing the above changes will keep the design as they are bug fixes for a few alignment issues. |
Thanks @parasharrajat! Updated! |
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.
Tests good @parasharrajat let us know if you wont be able to get to this review |
Reviewer Checklist
Screenshots/VideosDesktopsame as web |
Atually did the testing and we are good to go |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Thanks for taking care of this. I was asleep but I already tested. If suggestion were applied as it is then everything will be good. |
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.
LGTM
The issue should have been created automatically, since the PR points to an E/E internal issue. Not sure why it wasn't created. |
Created payment issue here |
Its created only when C+ approved the PR and Rajat could not do that after it was merged. |
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.12-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.12-0 🚀
|
@luacmartins please review
cc @grgia @parasharrajat
?w=1
review reccomendedDetails
After reverting the styles back to what they were originally in this PR: #18465 I went back to the drawing board to see how we could get the header to show properly for when we're using an
AvatarWithDisplayName
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/270587
Tests
(Internal, dev)
Apply the following diff to your local code:
Replace the reportID in this line:
... with the reportID of an IOU report you have locally.
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)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)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android