Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Sep 30, 2022
2 parents 8ead745 + e020676 commit a4e360b
Show file tree
Hide file tree
Showing 60 changed files with 508 additions and 387 deletions.
12 changes: 6 additions & 6 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
Expand Up @@ -64,7 +64,7 @@
"dom-serializer": "^0.2.2",
"domhandler": "^4.3.0",
"dotenv": "^8.2.0",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#a9e791c1190052e934c20efdcd7cd4429b4680cb",
"expensify-common": "git+https://github.com/Expensify/expensify-common.git#03a86215c0ae2bc4e7978e1ca9717fbc7fdea11b",
"fbjs": "^3.0.2",
"file-loader": "^6.0.0",
"html-entities": "^1.3.1",
Expand Down
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import HTMLEngineProvider from './components/HTMLEngineProvider';
import ComposeProviders from './components/ComposeProviders';
import SafeArea from './components/SafeArea';
import * as Environment from './libs/Environment/Environment';
import {WindowDimensionsProvider} from './components/withWindowDimensions';

// For easier debugging and development, when we are in web we expose Onyx to the window, so you can more easily set data into Onyx
if (window && Environment.isDevelopment()) {
Expand All @@ -37,6 +38,7 @@ const App = () => (
SafeArea,
LocaleContextProvider,
HTMLEngineProvider,
WindowDimensionsProvider,
]}
>
<CustomStatusBar />
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default {
// Holds information about the users account that is logging in
ACCOUNT: 'account',

// Holds the reportID for the report between the user and their account manager
ACCOUNT_MANAGER_REPORT_ID: 'accountManagerReportID',

// Boolean flag only true when first set
NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER: 'isFirstTimeNewExpensifyUser',

Expand Down
7 changes: 3 additions & 4 deletions src/components/ArchivedReportFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import compose from '../libs/compose';
import personalDetailsPropType from '../pages/personalDetailsPropType';
import ONYXKEYS from '../ONYXKEYS';
import * as ReportUtils from '../libs/ReportUtils';
import reportPropTypes from '../pages/reportPropTypes';

const propTypes = {
/** The reason this report was archived */
Expand All @@ -27,10 +28,7 @@ const propTypes = {
}),

/** The archived report */
report: PropTypes.shape({
/** The policy this report is attached to */
policyID: PropTypes.string,
}).isRequired,
report: reportPropTypes.isRequired,

/** Personal details of all users */
personalDetails: PropTypes.objectOf(personalDetailsPropType).isRequired,
Expand Down Expand Up @@ -72,6 +70,7 @@ const ArchivedReportFooter = (props) => {
policyName: `<strong>${ReportUtils.getPolicyName(props.report, props.policies)}</strong>`,
})}
shouldRenderHTML={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT}
shouldShowIcon
/>
);
};
Expand Down
72 changes: 60 additions & 12 deletions src/components/Banner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {memo} from 'react';
import PropTypes from 'prop-types';
import {View} from 'react-native';
import {View, Pressable} from 'react-native';
import compose from '../libs/compose';
import Hoverable from './Hoverable';
import Icon from './Icon';
import * as Expensicons from './Icon/Expensicons';
Expand All @@ -9,17 +10,45 @@ import Text from './Text';
import styles from '../styles/styles';
import * as StyleUtils from '../styles/StyleUtils';
import getButtonState from '../libs/getButtonState';
import Tooltip from './Tooltip';
import withLocalize, {withLocalizePropTypes} from './withLocalize';

const propTypes = {
/** Text to display in the banner. */
text: PropTypes.string.isRequired,

/** Should this component render the left-aligned exclamation icon? */
shouldShowIcon: PropTypes.bool,

/** Should this component render a close button? */
shouldShowCloseButton: PropTypes.bool,

/** Should this component render the text as HTML? */
shouldRenderHTML: PropTypes.bool,

/** Callback called when the close button is pressed */
onClose: PropTypes.func,

/** Callback called when the message is pressed */
onPress: PropTypes.func,

// eslint-disable-next-line react/forbid-prop-types
containerStyles: PropTypes.arrayOf(PropTypes.object),

// eslint-disable-next-line react/forbid-prop-types
textStyles: PropTypes.arrayOf(PropTypes.object),

...withLocalizePropTypes,
};

const defaultProps = {
shouldRenderHTML: false,
shouldShowIcon: false,
shouldShowCloseButton: false,
onClose: () => {},
onPress: () => {},
containerStyles: [],
textStyles: [],
};

const Banner = props => (
Expand All @@ -32,19 +61,35 @@ const Banner = props => (
styles.borderRadiusNormal,
isHovered ? styles.activeComponentBG : styles.hoveredComponentBG,
styles.breakAll,
...props.containerStyles,
]}
>
<View style={[styles.mr3]}>
<Icon
src={Expensicons.Exclamation}
fill={StyleUtils.getIconFillColor(getButtonState(isHovered))}
/>
<View style={[styles.flexRow, styles.flexGrow1, styles.mw100, styles.alignItemsCenter]}>
{props.shouldShowIcon && (
<View style={[styles.mr3]}>
<Icon
src={Expensicons.Exclamation}
fill={StyleUtils.getIconFillColor(getButtonState(isHovered))}
/>
</View>
)}
{
props.shouldRenderHTML
? <RenderHTML html={props.text} />
: <Text style={[...props.textStyles]} onPress={props.onPress}>{props.text}</Text>
}
</View>
{
props.shouldRenderHTML
? <RenderHTML html={props.text} />
: <Text>{props.text}</Text>
}
{props.shouldShowCloseButton && (
<Tooltip text={props.translate('common.close')}>
<Pressable
onPress={props.onClose}
accessibilityRole="button"
accessibilityLabel={props.translate('common.close')}
>
<Icon src={Expensicons.Close} />
</Pressable>
</Tooltip>
)}
</View>
)}
</Hoverable>
Expand All @@ -54,4 +99,7 @@ Banner.propTypes = propTypes;
Banner.defaultProps = defaultProps;
Banner.displayName = 'Banner';

export default memo(Banner);
export default compose(
withLocalize,
memo,
)(Banner);
18 changes: 2 additions & 16 deletions src/components/IOUBadge.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,11 @@ import compose from '../libs/compose';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
import CONST from '../CONST';
import Badge from './Badge';
import iouReportPropTypes from '../pages/iouReportPropTypes';

const propTypes = {
/** IOU Report data object */
iouReport: PropTypes.shape({
/** The report ID of the IOU */
reportID: PropTypes.number,

/** The report ID of the chat associated with the IOU */
chatReportID: PropTypes.number,

/** The total amount in cents */
total: PropTypes.number,

/** The owner of the IOUReport */
ownerEmail: PropTypes.string,

/** The currency of the IOUReport */
currency: PropTypes.string,
}),
iouReport: iouReportPropTypes,

/** Session of currently logged in user */
session: PropTypes.shape({
Expand Down
2 changes: 1 addition & 1 deletion src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const propTypes = {
keyForList: PropTypes.string,
isPinned: PropTypes.bool,
isUnread: PropTypes.bool,
reportID: PropTypes.number,
reportID: PropTypes.string,
// eslint-disable-next-line react/forbid-prop-types
participantsList: PropTypes.arrayOf(PropTypes.object),
payPalMeAddress: PropTypes.string,
Expand Down
8 changes: 4 additions & 4 deletions src/components/OnyxProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import ComposeProviders from './ComposeProviders';
const [withNetwork, NetworkProvider] = createOnyxContext(ONYXKEYS.NETWORK);
const [withPersonalDetails, PersonalDetailsProvider] = createOnyxContext(ONYXKEYS.PERSONAL_DETAILS);
const [withCurrentDate, CurrentDateProvider] = createOnyxContext(ONYXKEYS.CURRENT_DATE);
const [
withReportActionsDrafts,
ReportActionsDraftsProvider,
] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS);
const [withReportActionsDrafts, ReportActionsDraftsProvider] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS);
const [withBlockedFromConcierge, BlockedFromConciergeProvider] = createOnyxContext(ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE);

const propTypes = {
/** Rendered child component */
Expand All @@ -26,6 +24,7 @@ const OnyxProvider = props => (
PersonalDetailsProvider,
ReportActionsDraftsProvider,
CurrentDateProvider,
BlockedFromConciergeProvider,
]}
>
{props.children}
Expand All @@ -42,4 +41,5 @@ export {
withPersonalDetails,
withReportActionsDrafts,
withCurrentDate,
withBlockedFromConcierge,
};
10 changes: 3 additions & 7 deletions src/components/ReportWelcomeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ONYXKEYS from '../ONYXKEYS';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';
import Tooltip from './Tooltip';
import reportPropTypes from '../pages/reportPropTypes';

const personalDetailsPropTypes = PropTypes.shape({
/** The login of the person (either email or phone number) */
Expand All @@ -28,13 +29,7 @@ const personalDetailsPropTypes = PropTypes.shape({

const propTypes = {
/** The report currently being looked at */
report: PropTypes.shape({
/** The id of the report */
reportID: PropTypes.number,

/** The report owner's email */
ownerEmail: PropTypes.string,
}).isRequired,
report: reportPropTypes,

/* Onyx Props */

Expand All @@ -51,6 +46,7 @@ const propTypes = {
};

const defaultProps = {
report: {},
policies: {},
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/optionPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default PropTypes.shape({
login: PropTypes.string,

// reportID (only present when there is a matching report)
reportID: PropTypes.number,
reportID: PropTypes.string,

// Whether the report has read or not
isUnread: PropTypes.bool,
Expand Down
Loading

0 comments on commit a4e360b

Please sign in to comment.