From 7d723ae4cd10a228ea967023b318d39342744834 Mon Sep 17 00:00:00 2001 From: Mikhail Karkachov Date: Fri, 7 Jul 2023 21:49:27 +0200 Subject: [PATCH 001/137] 1. Added to marging to compose component. 2. Updated styling of messages scrollarea --- src/pages/home/report/ReportActionCompose.js | 1 + src/pages/home/report/ReportActionsList.js | 2 +- src/styles/styles.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index f47f546717dd..e619a6bb7f35 100644 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -960,6 +960,7 @@ class ReportActionCompose extends React.Component { styles.chatItemComposeBox, this.props.isComposerFullSize && styles.chatItemFullComposeBox, hasExceededMaxCommentLength && styles.borderColorDanger, + !shouldShowReportRecipientLocalTime && styles.mt4, ]} > Date: Fri, 7 Jul 2023 21:50:39 +0200 Subject: [PATCH 002/137] 1. Added to marging to compose component. 2. Updated styling of messages scrollarea --- src/pages/home/report/ReportActionsList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index 37148bba0a31..90cd9e1a57dc 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -148,7 +148,6 @@ function ReportActionsList(props) { // Native mobile does not render updates flatlist the changes even though component did update called. // To notify there something changes we can use extraData prop to flatlist const extraData = [props.isSmallScreenWidth ? props.newMarkerReportActionID : undefined, ReportUtils.isArchivedRoom(props.report)]; - const shouldShowReportRecipientLocalTime = ReportUtils.canShowReportRecipientLocalTime(props.personalDetailsList, props.report, props.currentUserPersonalDetails.accountID); return ( Date: Thu, 20 Jul 2023 17:44:52 +0700 Subject: [PATCH 003/137] fix: cannot paste magic code on mWeb iOS --- src/components/MagicCodeInput.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index 6fd14f34b7f1..97a734fe38d3 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -300,11 +300,6 @@ function MagicCodeInput(props) { } }; - // We need to check the browser because, in iOS Safari, an input in a container with its opacity set to - // 0 (completely transparent) cannot handle user interaction, hence the Paste option is never shown. - // Alternate styling will be applied based on this condition. - const isMobileSafari = Browser.isMobileSafari(); - return ( <> @@ -323,7 +318,7 @@ function MagicCodeInput(props) { > {decomposeString(props.value, props.maxLength)[index] || ''} - + (inputRefs.current[index] = ref)} autoFocus={index === 0 && props.autoFocus && !props.shouldDelayFocus} @@ -348,8 +343,8 @@ function MagicCodeInput(props) { onKeyPress={onKeyPress} onPress={(event) => onPress(event, index)} onFocus={onFocus} - caretHidden={isMobileSafari} - inputStyle={[isMobileSafari ? styles.magicCodeInputTransparent : undefined]} + caretHidden + inputStyle={[styles.magicCodeInputTransparent]} accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT} /> From 900798417c3563cc833697092625eb1e295d21af Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Jul 2023 02:56:27 +0700 Subject: [PATCH 004/137] fix double border --- src/components/MagicCodeInput.js | 5 ++++- src/styles/styles.js | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index 97a734fe38d3..4164fab27dc5 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -300,6 +300,8 @@ function MagicCodeInput(props) { } }; + const isBrowser = Boolean(Browser.getBrowser()); + return ( <> @@ -344,7 +346,8 @@ function MagicCodeInput(props) { onPress={(event) => onPress(event, index)} onFocus={onFocus} caretHidden - inputStyle={[styles.magicCodeInputTransparent]} + textInputContainerStyles={[styles.borderNone]} + inputStyle={[isBrowser ? styles.magicCodeInputTransparent : undefined]} accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT} /> diff --git a/src/styles/styles.js b/src/styles/styles.js index b889d0aea49c..b7508ae79523 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2535,7 +2535,6 @@ const styles = { magicCodeInputTransparent: { color: 'transparent', - caretColor: 'transparent', WebkitTextFillColor: 'transparent', // After setting the input text color to transparent, it acquires the background-color. // However, it is not possible to override the background-color directly as explained in this resource: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill From 623de6a5cb004a2128846840404a125ae74e6b1e Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Jul 2023 03:14:04 +0700 Subject: [PATCH 005/137] restore caretColor --- src/styles/styles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/styles.js b/src/styles/styles.js index b7508ae79523..b889d0aea49c 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2535,6 +2535,7 @@ const styles = { magicCodeInputTransparent: { color: 'transparent', + caretColor: 'transparent', WebkitTextFillColor: 'transparent', // After setting the input text color to transparent, it acquires the background-color. // However, it is not possible to override the background-color directly as explained in this resource: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill From 137f9b608788a6d832809395c5c2b5354575b26c Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Jul 2023 11:30:48 +0700 Subject: [PATCH 006/137] fix dev warnings webkit prop --- src/components/MagicCodeInput.js | 2 +- src/styles/styles.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index 4164fab27dc5..180195af9fcc 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -347,7 +347,7 @@ function MagicCodeInput(props) { onFocus={onFocus} caretHidden textInputContainerStyles={[styles.borderNone]} - inputStyle={[isBrowser ? styles.magicCodeInputTransparent : undefined]} + inputStyle={[styles.magicCodeInputTransparent, isBrowser ? styles.magicCodeInputTransparentWebKit : undefined]} accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT} /> diff --git a/src/styles/styles.js b/src/styles/styles.js index b889d0aea49c..f692741545eb 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2536,6 +2536,9 @@ const styles = { magicCodeInputTransparent: { color: 'transparent', caretColor: 'transparent', + }, + + magicCodeInputTransparentWebKit: { WebkitTextFillColor: 'transparent', // After setting the input text color to transparent, it acquires the background-color. // However, it is not possible to override the background-color directly as explained in this resource: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill From 0e77b18bd9a34379523d51f1f563c9af43f89ee2 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Jul 2023 13:11:02 +0700 Subject: [PATCH 007/137] hide caret --- src/components/MagicCodeInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MagicCodeInput.js b/src/components/MagicCodeInput.js index 180195af9fcc..2aa640c206bd 100644 --- a/src/components/MagicCodeInput.js +++ b/src/components/MagicCodeInput.js @@ -345,7 +345,7 @@ function MagicCodeInput(props) { onKeyPress={onKeyPress} onPress={(event) => onPress(event, index)} onFocus={onFocus} - caretHidden + selectionColor="transparent" textInputContainerStyles={[styles.borderNone]} inputStyle={[styles.magicCodeInputTransparent, isBrowser ? styles.magicCodeInputTransparentWebKit : undefined]} accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT} From fc7ac21c0263442901119a138de57a4f9ebeeb5a Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Jul 2023 13:11:30 +0700 Subject: [PATCH 008/137] fix dev warning caretColor --- src/styles/styles.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index f692741545eb..671ff70e6c53 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2535,7 +2535,6 @@ const styles = { magicCodeInputTransparent: { color: 'transparent', - caretColor: 'transparent', }, magicCodeInputTransparentWebKit: { From b5a35a1c70266d72a35b5a46d522bee574f879d0 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 21 Jul 2023 15:56:29 +0700 Subject: [PATCH 009/137] make caret transparent --- src/styles/styles.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles/styles.js b/src/styles/styles.js index 671ff70e6c53..cf2b0e76d203 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -2538,6 +2538,7 @@ const styles = { }, magicCodeInputTransparentWebKit: { + caretColor: 'transparent', WebkitTextFillColor: 'transparent', // After setting the input text color to transparent, it acquires the background-color. // However, it is not possible to override the background-color directly as explained in this resource: https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill From 53bc97eddbe60fed0703b12497940aeafdaacd13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20M=C3=B3rawski?= Date: Fri, 21 Jul 2023 18:58:22 +0300 Subject: [PATCH 010/137] ui and first data flow attemps merchant and date value are taken from the "iou" key-value pair. Clearing this up with Alex. --- .../MoneyRequestConfirmationList.js | 53 +++- src/components/MoneyRequestDetails.js | 28 +- src/languages/en.js | 120 ++++---- src/languages/es.js | 118 ++++---- src/libs/actions/IOU.js | 285 ++++++++++-------- .../iou/steps/MoneyRequestConfirmPage.js | 21 +- 6 files changed, 355 insertions(+), 270 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index b376e02b1095..37e83692f658 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -1,25 +1,28 @@ -import React, {useState, useCallback, useMemo} from 'react'; +import React, { useCallback, useMemo, useReducer, useState } from 'react'; import PropTypes from 'prop-types'; -import {withOnyx} from 'react-native-onyx'; +import { withOnyx } from 'react-native-onyx'; import _ from 'underscore'; +import { View } from 'react-native'; import styles from '../styles/styles'; import * as OptionsListUtils from '../libs/OptionsListUtils'; import OptionsSelector from './OptionsSelector'; import ONYXKEYS from '../ONYXKEYS'; -import withLocalize, {withLocalizePropTypes} from './withLocalize'; -import withWindowDimensions, {windowDimensionsPropTypes} from './withWindowDimensions'; +import withLocalize, { withLocalizePropTypes } from './withLocalize'; +import withWindowDimensions, { windowDimensionsPropTypes } from './withWindowDimensions'; import compose from '../libs/compose'; import CONST from '../CONST'; import ButtonWithDropdownMenu from './ButtonWithDropdownMenu'; import Log from '../libs/Log'; import SettlementButton from './SettlementButton'; import ROUTES from '../ROUTES'; -import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsPropTypes, withCurrentUserPersonalDetailsDefaultProps} from './withCurrentUserPersonalDetails'; +import withCurrentUserPersonalDetails, { withCurrentUserPersonalDetailsDefaultProps, withCurrentUserPersonalDetailsPropTypes } from './withCurrentUserPersonalDetails'; import * as IOUUtils from '../libs/IOUUtils'; import MenuItemWithTopDescription from './MenuItemWithTopDescription'; import Navigation from '../libs/Navigation/Navigation'; import optionPropTypes from './optionPropTypes'; import * as CurrencyUtils from '../libs/CurrencyUtils'; +import Button from './Button'; +import * as Expensicons from './Icon/Expensicons'; const propTypes = { /** Callback to inform parent modal of success */ @@ -82,9 +85,9 @@ const propTypes = { }; const defaultProps = { - onConfirm: () => {}, - onSendMoney: () => {}, - onSelectParticipant: () => {}, + onConfirm: () => { }, + onSendMoney: () => { }, + onSelectParticipant: () => { }, iouType: CONST.IOU.MONEY_REQUEST_TYPE.REQUEST, payeePersonalDetails: null, canModifyParticipants: false, @@ -101,7 +104,10 @@ const defaultProps = { function MoneyRequestConfirmationList(props) { // Destructure functions from props to pass it as a dependecy to useCallback/useMemo hooks. // Prop functions pass props itself as a "this" value to the function which means they change every time props change. - const {translate, onSendMoney, onConfirm, onSelectParticipant} = props; + const { translate, onSendMoney, onConfirm, onSelectParticipant } = props; + + // A flag and a toggler for showing the rest of the form fields + const [showAllFields, toggleShowAllFields] = useReducer((state) => !state, false); /** * Returns the participants with amount @@ -272,6 +278,7 @@ function MoneyRequestConfirmationList(props) { /> ); }, [confirm, props.selectedParticipants, props.bankAccountRoute, props.iouCurrencyCode, props.iouType, props.isReadOnly, props.policyID, selectedParticipants, splitOrRequestOptions]); + console.log('list', props); return ( + + +