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

🍒 Cherry pick PR #5796 to staging 🍒 #5825

Merged
merged 2 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001010711
versionName "1.1.7-11"
versionCode 1001010712
versionName "1.1.7-12"
}
splits {
abi {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.7.11</string>
<string>1.1.7.12</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.7.11</string>
<string>1.1.7.12</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.1.7-11",
"version": "1.1.7-12",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
16 changes: 10 additions & 6 deletions src/components/MenuItem.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'underscore';
import React from 'react';
import {
View, Pressable,
Expand All @@ -19,7 +20,7 @@ const propTypes = {
const defaultProps = {
badgeText: undefined,
shouldShowRightIcon: false,
wrapperStyle: {},
wrapperStyle: [],
success: false,
icon: undefined,
iconWidth: undefined,
Expand All @@ -32,6 +33,8 @@ const defaultProps = {
disabled: false,
subtitle: undefined,
iconType: 'icon',
onPress: () => {},
interactive: true,
};

const MenuItem = ({
Expand All @@ -52,6 +55,7 @@ const MenuItem = ({
disabled,
subtitle,
iconType,
interactive,
}) => (
<Pressable
onPress={(e) => {
Expand All @@ -63,8 +67,8 @@ const MenuItem = ({
}}
style={({hovered, pressed}) => ([
styles.popoverMenuItem,
getButtonBackgroundColorStyle(getButtonState(focused || hovered, pressed, success, disabled)),
wrapperStyle,
getButtonBackgroundColorStyle(getButtonState(focused || hovered, pressed, success, disabled, interactive)),
..._.isArray(wrapperStyle) ? wrapperStyle : [wrapperStyle],
])}
disabled={disabled}
>
Expand All @@ -83,7 +87,7 @@ const MenuItem = ({
width={iconWidth}
height={iconHeight}
fill={iconFill || getIconFillColor(
getButtonState(focused || hovered, pressed, success, disabled),
getButtonState(focused || hovered, pressed, success, disabled, interactive),
)}
/>
</View>
Expand All @@ -106,7 +110,7 @@ const MenuItem = ({
style={[
styles.popoverMenuText,
styles.ml3,
(disabled ? styles.disabledText : undefined),
(interactive && disabled ? styles.disabledText : undefined),
]}
numberOfLines={1}
>
Expand Down Expand Up @@ -134,7 +138,7 @@ const MenuItem = ({
<View style={styles.popoverMenuIcon}>
<Icon
src={iconRight}
fill={getIconFillColor(getButtonState(focused || hovered, pressed, success, disabled))}
fill={getIconFillColor(getButtonState(focused || hovered, pressed, success, disabled, interactive))}
/>
</View>
)}
Expand Down
8 changes: 6 additions & 2 deletions src/components/menuItemPropTypes.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import PropTypes from 'prop-types';
import CONST from '../CONST';
import stylePropTypes from '../styles/stylePropTypes';

const propTypes = {
/** Text to be shown as badge near the right end. */
badgeText: PropTypes.string,

/** Any additional styles to apply */
// eslint-disable-next-line react/forbid-prop-types
wrapperStyle: PropTypes.object,
wrapperStyle: stylePropTypes,

/** Function to fire when component is pressed */
onPress: PropTypes.func.isRequired,
onPress: PropTypes.func,

/** Icon to display on the left side of component */
icon: PropTypes.oneOfType([PropTypes.elementType, PropTypes.string]),
Expand Down Expand Up @@ -53,6 +54,9 @@ const propTypes = {

/** Flag to choose between avatar image or an icon */
iconType: PropTypes.oneOf([CONST.ICON_TYPE_AVATAR, CONST.ICON_TYPE_ICON]),

/** Whether the menu item should be interactive at all */
interactive: PropTypes.bool,
};

export default propTypes;
7 changes: 6 additions & 1 deletion src/libs/getButtonState.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ import CONST from '../CONST';
* @param {Boolean} [isPressed]
* @param {Boolean} [isComplete]
* @param {Boolean} [isDisabled]
* @param {Boolean} [isInteractive]
* @returns {String}
*/
export default function (isActive = false, isPressed = false, isComplete = false, isDisabled = false) {
export default function (isActive = false, isPressed = false, isComplete = false, isDisabled = false, isInteractive = true) {
if (!isInteractive) {
return CONST.BUTTON_STATES.DEFAULT;
}

if (isDisabled) {
return CONST.BUTTON_STATES.DISABLED;
}
Expand Down
5 changes: 3 additions & 2 deletions src/pages/ReimbursementAccount/EnableStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ class EnableStep extends React.Component {
icon={icon}
iconWidth={iconSize}
iconHeight={iconSize}
onPress={() => {}}
wrapperStyle={{paddingHorizontal: 0, marginBottom: 12}}
disabled
interactive={false}
wrapperStyle={[styles.ph0, styles.mb3]}
/>
<Text>
{!isUsingExpensifyCard
Expand Down