Skip to content

Commit

Permalink
Merge branch 'main' into 17034-migrate-HeaderWithCloseButton
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Jun 2, 2023
2 parents c417792 + 43df7df commit 57d6027
Show file tree
Hide file tree
Showing 50 changed files with 398 additions and 221 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001032200
versionName "1.3.22-0"
versionCode 1001032303
versionName "1.3.23-3"
}

splits {
Expand Down
6 changes: 5 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ platform :ios do
contact_phone: ENV["APPLE_CONTACT_PHONE"],
demo_account_name: ENV["APPLE_DEMO_EMAIL"],
demo_account_password: ENV["APPLE_DEMO_PASSWORD"],
notes: "Use the account provided. Thank you for the review."
notes: "1. Log into the Expensify app using the provided email
2. Now, you have to log in to this gmail account on https://mail.google.com/ so you can retrieve a One-Time-Password
3. To log in to the gmail account, use the password above (That's NOT a password for the Expensify app but for the Gmail account)
4. At the Gmail inbox, you should have received a one-time 6 digit magic code
5. Use that to sign in"
}
)
rescue Exception => e
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.22</string>
<string>1.3.23</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.22.0</string>
<string>1.3.23.3</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.22</string>
<string>1.3.23</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.22.0</string>
<string>1.3.23.3</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1135,4 +1135,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4ed1c7b099741c82e2b0411b95f6468e72be6c76

COCOAPODS: 1.12.1
COCOAPODS: 1.12.0
4 changes: 2 additions & 2 deletions 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.3.22-0",
"version": "1.3.23-3",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ const BaseAnchorForCommentsOnly = (props) => {
linkProps.href = props.href;
}
const defaultTextStyle = DeviceCapabilities.canUseTouchScreen() || props.isSmallScreenWidth ? {} : styles.userSelectText;
const isEmail = Str.isValidEmailMarkdown(props.href.replace(/mailto:/i, ''));

return (
<PressableWithSecondaryInteraction
inline
onSecondaryInteraction={(event) => {
ReportActionContextMenu.showContextMenu(
Str.isValidEmailMarkdown(props.href.replace(/mailto:/i, '')) ? ContextMenuActions.CONTEXT_MENU_TYPES.EMAIL : ContextMenuActions.CONTEXT_MENU_TYPES.LINK,
isEmail ? ContextMenuActions.CONTEXT_MENU_TYPES.EMAIL : ContextMenuActions.CONTEXT_MENU_TYPES.LINK,
event,
props.href,
lodashGet(linkRef, 'current'),
Expand All @@ -67,7 +68,7 @@ const BaseAnchorForCommentsOnly = (props) => {
accessibilityRole="link"
hrefAttrs={{
rel: props.rel,
target: props.target,
target: isEmail ? '_self' : props.target,
}}
href={linkProps.href}
// Add testID so it gets selected as an anchor tag by SelectionScraper
Expand Down
31 changes: 21 additions & 10 deletions src/components/CalendarPicker/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'underscore';
import React from 'react';
import {View, TouchableOpacity, Pressable} from 'react-native';
import {View} from 'react-native';
import moment from 'moment';
import Str from 'expensify-common/lib/str';
import Text from '../Text';
Expand All @@ -14,6 +14,8 @@ import ROUTES from '../../ROUTES';
import CONST from '../../CONST';
import getButtonState from '../../libs/getButtonState';
import * as StyleUtils from '../../styles/StyleUtils';
import PressableWithFeedback from '../Pressable/PressableWithFeedback';
import PressableWithoutFeedback from '../Pressable/PressableWithoutFeedback';

class CalendarPicker extends React.PureComponent {
constructor(props) {
Expand Down Expand Up @@ -206,9 +208,12 @@ class CalendarPicker extends React.PureComponent {
return (
<View>
<View style={[styles.calendarHeader, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ph4, styles.pr1]}>
<TouchableOpacity
<PressableWithFeedback
onPress={this.onYearPickerPressed}
style={[styles.alignItemsCenter, styles.flexRow, styles.flex1, styles.justifyContentStart]}
wrapperStyle={[styles.alignItemsCenter]}
hoverDimmingValue={1}
accessibilityLabel={this.props.translate('common.currentYear')}
>
<Text
style={styles.sidebarLinkTextBold}
Expand All @@ -218,7 +223,7 @@ class CalendarPicker extends React.PureComponent {
{currentYearView}
</Text>
<ArrowIcon />
</TouchableOpacity>
</PressableWithFeedback>
<View style={[styles.alignItemsCenter, styles.flexRow, styles.flex1, styles.justifyContentEnd]}>
<Text
style={styles.sidebarLinkTextBold}
Expand All @@ -227,23 +232,27 @@ class CalendarPicker extends React.PureComponent {
>
{monthNames[currentMonthView]}
</Text>
<TouchableOpacity
<PressableWithFeedback
testID="prev-month-arrow"
disabled={!hasAvailableDatesPrevMonth}
onPress={this.moveToPrevMonth}
hoverDimmingValue={1}
accessibilityLabel={this.props.translate('common.previous')}
>
<ArrowIcon
disabled={!hasAvailableDatesPrevMonth}
direction={CONST.DIRECTION.LEFT}
/>
</TouchableOpacity>
<TouchableOpacity
</PressableWithFeedback>
<PressableWithFeedback
testID="next-month-arrow"
disabled={!hasAvailableDatesNextMonth}
onPress={this.moveToNextMonth}
hoverDimmingValue={1}
accessibilityLabel={this.props.translate('common.next')}
>
<ArrowIcon disabled={!hasAvailableDatesNextMonth} />
</TouchableOpacity>
</PressableWithFeedback>
</View>
</View>
<View style={styles.flexRow}>
Expand All @@ -269,25 +278,27 @@ class CalendarPicker extends React.PureComponent {
const isSelected = moment(this.props.value).isSame(moment([currentYearView, currentMonthView, day]), 'day');

return (
<Pressable
<PressableWithoutFeedback
key={`${index}_day-${day}`}
disabled={isDisabled}
onPress={() => this.onDayPressed(day)}
style={styles.calendarDayRoot}
accessibilityLabel={day ? day.toString() : undefined}
focusable={Boolean(day)}
accessible={Boolean(day)}
>
{({hovered, pressed}) => (
<View
style={[
styles.calendarDayContainer,
isSelected ? styles.calendarDayContainerSelected : {},
StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed)),
!isDisabled ? StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed)) : {},
]}
>
<Text style={isDisabled ? styles.buttonOpacityDisabled : styles.dayText}>{day}</Text>
</View>
)}
</Pressable>
</PressableWithoutFeedback>
);
})}
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmojiPicker/CategoryShortcutBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const propTypes = {
};

const CategoryShortcutBar = (props) => (
<View style={[styles.pt2, styles.ph4, styles.flexRow]}>
<View style={[styles.ph4, styles.flexRow]}>
{_.map(props.headerEmojis, (headerEmoji, i) => (
<CategoryShortcutButton
icon={headerEmoji.icon}
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmojiPicker/EmojiPickerMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class EmojiPickerMenu extends Component {
pointerEvents={this.state.arePointerEventsDisabled ? 'none' : 'auto'}
>
{!this.props.isSmallScreenWidth && (
<View style={[styles.ph4, styles.pb2, styles.pt2]}>
<View style={[styles.ph4, styles.pb3, styles.pt2]}>
<TextInput
label={this.props.translate('common.search')}
onChangeText={this.filterEmojis}
Expand Down
13 changes: 12 additions & 1 deletion src/components/HeaderWithCloseButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import AvatarWithDisplayName from './AvatarWithDisplayName';
import iouReportPropTypes from '../pages/iouReportPropTypes';
import participantPropTypes from './participantPropTypes';
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';
import PinButton from './PinButton';

const propTypes = {
/** Title of the Header */
Expand Down Expand Up @@ -51,6 +52,9 @@ const propTypes = {
/** Whether we should show a get assistance (question mark) button */
shouldShowGetAssistanceButton: PropTypes.bool,

/** Whether we should show a pin button */
shouldShowPinButton: PropTypes.bool,

/** Whether we should show a more options (threedots) button */
shouldShowThreeDotsButton: PropTypes.bool,

Expand Down Expand Up @@ -84,6 +88,9 @@ const propTypes = {
/** Whether we should show an avatar */
shouldShowAvatarWithDisplay: PropTypes.bool,

/** Parent report, if provided it will override props.report for AvatarWithDisplay */
parentReport: iouReportPropTypes,

/** Report, if we're showing the details for one and using AvatarWithDisplay */
report: iouReportPropTypes,

Expand Down Expand Up @@ -113,10 +120,12 @@ const defaultProps = {
shouldShowDownloadButton: false,
shouldShowGetAssistanceButton: false,
shouldShowThreeDotsButton: false,
shouldShowPinButton: false,
shouldShowCloseButton: true,
shouldShowStepCounter: true,
shouldShowAvatarWithDisplay: false,
report: null,
parentReport: null,
policies: {},
personalDetails: {},
guidesCallTaskID: '',
Expand Down Expand Up @@ -171,7 +180,7 @@ class HeaderWithCloseButton extends Component {
)}
{this.props.shouldShowAvatarWithDisplay && (
<AvatarWithDisplayName
report={this.props.report}
report={this.props.parentReport || this.props.report}
policies={this.props.policies}
personalDetails={this.props.personalDetails}
/>
Expand Down Expand Up @@ -217,6 +226,8 @@ class HeaderWithCloseButton extends Component {
</Tooltip>
)}

{this.props.shouldShowPinButton && <PinButton report={this.props.report} />}

{this.props.shouldShowThreeDotsButton && (
<ThreeDotsMenu
menuItems={this.props.threeDotsMenuItems}
Expand Down
5 changes: 5 additions & 0 deletions src/components/ImageWithSizeCalculation.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class ImageWithSizeCalculation extends PureComponent {
}

imageLoadingStart() {
// Return early if the image has already loaded (this can happen when uploading the same image twice on Android)
if (this.isLoaded) {
return;
}
this.setState({isLoading: true});
}

Expand All @@ -60,6 +64,7 @@ class ImageWithSizeCalculation extends PureComponent {
}

imageLoadedSuccessfully(event) {
this.isLoaded = true;
this.props.onMeasure({
width: event.nativeEvent.width,
height: event.nativeEvent.height,
Expand Down
Loading

0 comments on commit 57d6027

Please sign in to comment.