Closed thienlnam closed 1 year ago
Current:
Styles should look like
Job added to Upwork: https://www.upwork.com/jobs/~018dddd8a08831da39
Triggered auto assignment to @muttmuure (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (External
)
Current assignee @thienlnam is eligible for the External assigner, not assigning anyone new.
Make task page confirmation styles consistent
Not a bug but a feature.
We have to edit our MenuItem
component such that it supports following new props:
withoutHover: By default, MenuItem
when hovered, shows a different background colour. To circumvent this, we have to check the value of the new props withoutHover
here. This gets replaced by:
StyleUtils.getButtonBackgroundColorStyle(getButtonState(props.focused || (props.withHover && hovered), pressed, props.success, props.disabled, props.interactive), true),
alternateText: In order to display text on top of the MenuItem
like in the image below, we have to use another prop called alternateText
. This can be added here:
{props.alternateText &&
<View style={[styles.pl5]}>
<Text style={StyleUtils.combineStyles(styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting, styles.pre)}>{props.alternateText}</Text>
</View>
}
Lastly, we also need to support an array of icon
in the MenuItems
component. In order to achieve this, we have to change this condition to:
{Boolean(props.icon) && !_.isArray(props.icon) && (
At top of this condition, we have to add the following:
{Boolean(props.icon) && _.isArray(props.icon) && (
<MultipleAvatars
icons={props.icon}
size={CONST.AVATAR_SIZE.DEFAULT}
secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(themeColors.appBG)]}
/>
)}
Once these changes are applied, we can use MenuItem
instead of TaskSelectorLink
as follow:
<MenuItem
alternateText={assignee.displayName ? props.translate('newTaskPage.assignee'): ''}
title={assignee.displayName ? assignee.displayName : props.translate('newTaskPage.assignee')}
description={assignee.subtitle}
onPress={() => Navigation.navigate(ROUTES.NEW_TASK_ASSIGNEE)}
shouldShowRightIcon
icon={assignee.icons}
withHover={false}
/>
Once we use the MenuItem
we won't need the horizontal padding that we use here.
The approach can be further optimised in a PR.
This needs to be changed to:
<Text style={[styles.label, styles.textLabelSupporting, props.icons.length > 0 ? styles.mb2 : styles.mb0]}>{props.translate(props.label)}</Text>
This needs to be changed to:
<Icon
src={Expensicons.ArrowRight}
fill={themeColors.icon}
width={variables.iconSizeNormal}
height={variables.iconSizeNormal}
inline
/>
Inconsistent styling on create task push to page
Not providing right styles to the text and icons
We could make the styles consistent by changing these lines -
<Text style={[styles.label, styles.textLabelSupporting, props.icons.length > 0 ? styles.mb2 : styles.mb0]}>{props.translate(props.label)}</Text>
and pass these styles to icon -
<Icon src={Expensicons.ArrowRight} fill={themeColors.icon} width={variables.iconSizeNormal} height={variables.iconSizeNormal} inline />
@allroundexperts Thanks for the proposal. Can we re-use MenuItemWithTopDescription
instead of recreating the component?
@sethraj14 Thanks for the proposal. Same question as above ^
@allroundexperts Thanks for the proposal. Can we re-use
MenuItemWithTopDescription
instead of recreating the component?
Yep. We can. Posting 'how' in some time.
@allroundexperts Thanks for the proposal. Can we re-use
MenuItemWithTopDescription
instead of recreating the component?
Yes, I was exploring the same as we use this in every other place.
@s77rt Proposal updated.
@s77rt
Inconsistent styling on create task push to page
Not providing right styles to the text and icons
In order to shift to MenuItemWithTopDescription we have these fields to map -
label
-> description
(with props.translate(text
-> title
onPress
-> onPress
disabled
-> shouldShowRightIcon
alternateText
-> Add new props alternateText
to MenuItem icon
-> Add support for array of icons After adding these props, we need to change the MenuItem file like this here-
{Boolean(props.icon) && _.isArray(props.icon) && (
<MultipleAvatars
icons={props.icon}
size={CONST.AVATAR_SIZE.DEFAULT}
secondAvatarStyle={[StyleUtils.getBackgroundAndBorderStyle(themeColors.appBG)]}
/>
)}
{Boolean(props.alternateText) && (
<View style={[styles.pl0]}>
<Text
style={titleTextStyle}
numberOfLines={1}
>
{convertToLTR(props.title)}
</Text>
<Text style={StyleUtils.combineStyles(styles.sidebarLinkText, styles.optionAlternateText, styles.textLabelSupporting, styles.pre)}>
{props.alternateText}
</Text>
</View>
)}
Hover should be there as it will be consistent with other similar screens.
Discard isShareDestination
as it is not doing anything in the current implementation
Finally the NewTaskPage file will look like this -
<ScrollView>
<View style={styles.flex1}>
<MenuItemWithTopDescription
description={props.translate('newTaskPage.title')}
title={props.task.title}
onPress={() => Navigation.navigate(ROUTES.NEW_TASK_TITLE)}
shouldShowRightIcon={true}
/>
<MenuItemWithTopDescription
description={props.translate('newTaskPage.description')}
title={props.task.description}
onPress={() => Navigation.navigate(ROUTES.NEW_TASK_DESCRIPTION)}
shouldShowRightIcon={true}
/>
<MenuItemWithTopDescription
alternateText={assignee.subtitle}
description={props.translate('newTaskPage.assignee')}
title={assignee.displayName || ''}
onPress={() => Navigation.navigate(ROUTES.NEW_TASK_ASSIGNEE)}
shouldShowRightIcon={true}
icon={assignee.icons}
/>
<MenuItemWithTopDescription
alternateText={shareDestination.subtitle}
description={props.translate('newTaskPage.shareSomewhere')}
title={shareDestination.displayName || ''}
onPress={() => Navigation.navigate(ROUTES.NEW_TASK_SHARE_DESTINATION)}
shouldShowRightIcon={true}
icon={shareDestination.icons}
/>
<FormAlertWithSubmitButton
isAlertVisible={submitError}
message={errorMessage}
onSubmit={() => onSubmit()}
enabledWhenOffline
buttonText={props.translate('newTaskPage.confirmTask')}
containerStyles={[styles.mh0, styles.mt5, styles.flex1]}
/>
</View>
</ScrollView>
The final solution will be cleaned and optimized.
We could make the styles consistent by changing these lines -
<Text style={[styles.label, styles.textLabelSupporting, props.icons.length > 0 ? styles.mb2 : styles.mb0]}>{props.translate(props.label)}</Text>
and pass these styles to icon -
<Icon src={Expensicons.ArrowRight} fill={themeColors.icon} width={variables.iconSizeNormal} height={variables.iconSizeNormal} inline />
Looks like something related to react-navigation
may have been mentioned in this issue discussion.
As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js
files should not be accepted.
Feel free to drop a note in #expensify-open-source with any questions.
@allroundexperts Thanks. This is looking good but let's not worry about the hover style, it's better to keep it for consistency.
:ribbon: :eyes: :ribbon: C+ reviewed
cc @thienlnam
@sethraj14 Thanks. I think the idea is the same as @allroundexperts's so we will just go with the first. But feel free to check other issues with Help Wanted label here.
📣 @allroundexperts You have been assigned to this job by @thienlnam! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
Assigned, thanks! Also one more thing can we make sure to add a bold style to the assignee name while we're already here?
PR created https://github.com/Expensify/App/pull/20145
@s77rt, @allroundexperts, @thienlnam, @muttmuure Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue. PR is merged.
Not on prod yet
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.27-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-06-21. :confetti_ball:
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
@allroundexperts @s77rt invited to job
@muttmuure Applied!
Offer sent to @s77rt. Still waiting on @allroundexperts to apply
Offer sent to @s77rt. Still waiting on @allroundexperts to apply
Can you send me the link please?
@muttmuure Accepted!
@s77rt paid, @allroundexperts offer sent
@s77rt paid, @allroundexperts offer sent
@muttmuure Accepted!
I think we're all good here? @allroundexperts Did your contract get paid out?
Seems like its still in progress @thienlnam.
Contract paid out for @allroundexperts too.
Thanks for your patience here!
https://expensify.slack.com/archives/C04QEB4MJEQ/p1685378425623999
The labels should use our textSupporting color The small label should be closer to the value the arrows/carets should use our icon color and should be at 20x20
The style on the second step of creating a task is inconsistent with the push-to-page style from other places in the app. I feel like we keep recreating this style instead of just using the same global component.
Upwork Automation - Do Not Edit