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

Update version to 1.2.81-0 on staging #15766

Merged
merged 216 commits into from
Mar 9, 2023
Merged
Changes from 1 commit
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
edd1455
Squashed commit of the following:
JediWattson Jan 26, 2023
519925d
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Jan 26, 2023
962aaf2
removed undefined function
JediWattson Jan 26, 2023
0cb9e60
use dimension height to get image height
JediWattson Jan 27, 2023
33bd189
added cancel when image changes
JediWattson Jan 27, 2023
a09b349
fixed hook
JediWattson Jan 27, 2023
f9948a6
added loading indicator when event is handled, removed logic preventi…
JediWattson Jan 30, 2023
674af4f
added back layout for issue with size
JediWattson Jan 31, 2023
3d2dd78
Merge branch 'main' into arrow-feature-signed
JediWattson Feb 2, 2023
80d6746
fixing lint issues
JediWattson Feb 2, 2023
180c52b
changed var name
JediWattson Feb 2, 2023
1883524
reverting action load
JediWattson Feb 2, 2023
19aa567
fixed logic to allow cursor index to change
JediWattson Feb 3, 2023
b58bfde
linting
JediWattson Feb 3, 2023
011f4cc
removed unused function, use props to constant url associated with image
JediWattson Feb 4, 2023
99d7126
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 4, 2023
a853953
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 7, 2023
5ae7925
fixed glitchy issue with imgs, check if deleted
JediWattson Feb 8, 2023
b1f2fdb
fixing lint
JediWattson Feb 8, 2023
7bfbb1f
added on press event for arrow
JediWattson Feb 9, 2023
ccb8cbd
add default
JediWattson Feb 9, 2023
390e6ed
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 9, 2023
34dc3ea
Merge branch 'main' into arrow-feature-signed
JediWattson Feb 11, 2023
e49b52c
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 13, 2023
1ea47cc
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 13, 2023
7e2861a
set zoom to false when changing images
JediWattson Feb 13, 2023
67f955f
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 13, 2023
37b3fd9
fixed issue with zoom, set zoom to 1 on mobile
JediWattson Feb 15, 2023
b6ce704
lint fixes
JediWattson Feb 15, 2023
cec9ba8
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 15, 2023
80333cb
wip: render quick reactions in context menu
hannojg Feb 15, 2023
071b88f
wip: adjustments for web
hannojg Feb 15, 2023
a984a0b
add actions for adding and removing reactions
hannojg Feb 15, 2023
f96b73b
wip: add reaction when using quick reactions
hannojg Feb 15, 2023
a164fa1
render emoji reactions underneath a message
hannojg Feb 15, 2023
f0926c1
TEMP: REMOVE ME once accountID on personal details is live
hannojg Feb 15, 2023
318931f
change from `login` to `accountID`
hannojg Feb 15, 2023
549bcbe
wip: adding / removing
hannojg Feb 15, 2023
43ad6e7
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 15, 2023
c7de8cd
change: when removing reactions, remove the whole emoji object
hannojg Feb 16, 2023
7281f82
cleanup code
hannojg Feb 16, 2023
7907fd2
show AddReactionBubble in the row of reactions as well
hannojg Feb 16, 2023
71220c0
implemented toggling reactions when selecting the same again
hannojg Feb 16, 2023
44909ab
close context menu when open emoji picker or selected emoji
hannojg Feb 16, 2023
8042b9b
fix emoji picker being wrong positioned
hannojg Feb 16, 2023
483b119
wip: mini menu
hannojg Feb 16, 2023
20d463c
wip: mini menu adding add reaction icon
hannojg Feb 16, 2023
99bfb91
fix: mini menu open picker wrong positioned + was closing
hannojg Feb 16, 2023
2f61782
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Feb 16, 2023
c3715f7
Merge branch 'main' into arrow-feature-signed
JediWattson Feb 17, 2023
85357b1
fix: open emoji picker on mobile
hannojg Feb 17, 2023
4c07ba2
clean up
hannojg Feb 17, 2023
e064297
rename and document functions
hannojg Feb 19, 2023
52a9135
pick the preferred skin tone
hannojg Feb 19, 2023
c8c450c
updated JSDocs
hannojg Feb 19, 2023
bf7d78e
updated JSDocs
hannojg Feb 19, 2023
f874ea5
updated JSDocs
hannojg Feb 19, 2023
267338e
remove todos
hannojg Feb 19, 2023
b09e44d
apply suggestions from design doc
hannojg Feb 19, 2023
1b8041f
apply suggestions from design doc
hannojg Feb 19, 2023
33c0554
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Feb 19, 2023
8675022
fix tests
hannojg Feb 19, 2023
57082d6
fix: pas emoji object directly
hannojg Feb 20, 2023
28f80d3
refactor: pass ref optional as arg
hannojg Feb 20, 2023
ba6970e
fix: pass anchor position for emoji picker as well to fix issue with …
hannojg Feb 20, 2023
f2e407c
apply suggestions from code review
hannojg Feb 20, 2023
87acc95
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 21, 2023
4c32e2d
added logic for paging for ngrok
JediWattson Feb 21, 2023
2d6eb88
fixed worker import to load pdf
JediWattson Feb 21, 2023
a2fde3b
fix IsIOUOwnedByCurrentUser
luacmartins Feb 22, 2023
e39513e
fix getOrderedReportIDs logic for outstanding IOUs
luacmartins Feb 22, 2023
70f5212
clean up logic
luacmartins Feb 22, 2023
7a1dcf8
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 22, 2023
c151e73
use tryResolveUrlFromApiRoot to get correct urls
JediWattson Feb 22, 2023
b0fc2dc
Revert "fixed worker import to load pdf"
JediWattson Feb 22, 2023
4b0da92
add leaveRoom action
marcochavezf Feb 22, 2023
60dccf3
hook up leaveRoom action to Leave room button
marcochavezf Feb 22, 2023
60f2002
add new visibility values
marcochavezf Feb 23, 2023
3c49baa
add missing visibility value
marcochavezf Feb 23, 2023
6760e66
add canLeaveRoom function
marcochavezf Feb 23, 2023
f4885e6
hide the Leave room button if use cannot leave
marcochavezf Feb 23, 2023
85f93a1
add comment
marcochavezf Feb 23, 2023
f6eb54a
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 23, 2023
6363c52
removed extraspaces
JediWattson Feb 24, 2023
349ccdb
ran lint fix
JediWattson Feb 24, 2023
1934508
adding loading when getting new attachments
JediWattson Feb 24, 2023
f03ac5a
added check for when no attachments get loaded
JediWattson Feb 24, 2023
3daf910
Merge branch 'main' into arrow-feature-signed
JediWattson Feb 24, 2023
6a720dd
Revert "added check for when no attachments get loaded"
JediWattson Feb 27, 2023
8d419e4
Revert "adding loading when getting new attachments"
JediWattson Feb 27, 2023
60b3962
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 27, 2023
b58d023
Prevent download tooltip from overlapping Growl notification
redstar504 Feb 27, 2023
97c8d08
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Feb 28, 2023
3b24a03
enable API calls
hannojg Feb 28, 2023
ac3d4dc
removed code for updating actions
JediWattson Feb 28, 2023
1982c49
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Feb 28, 2023
ea547ce
Merge branch 'main' into marco-addLeaveRoomAction
marcochavezf Mar 1, 2023
6bfc8bb
fixed up logic and some comments
JediWattson Mar 1, 2023
8304865
fixed isLoading to show indicator
JediWattson Mar 1, 2023
778374a
linting
JediWattson Mar 1, 2023
d476dc7
switched values in arrows to make intuitive
JediWattson Mar 1, 2023
4fec5ff
include only public and public_announce values
marcochavezf Mar 1, 2023
a48c312
fix Policy.leaveRoom
marcochavezf Mar 1, 2023
d3a7f24
fix New Room page
marcochavezf Mar 1, 2023
9dcc676
update canLeaveRoom logic
marcochavezf Mar 2, 2023
d1ce25d
add new visibilityOptions
marcochavezf Mar 2, 2023
48cf798
open concierge when user leaves room
marcochavezf Mar 2, 2023
aced8a8
update logic to show Leave Room button
marcochavezf Mar 2, 2023
7e4c64b
check if policy exists for the user
marcochavezf Mar 2, 2023
078513d
Merge branch 'main' into marco-addLeaveRoomAction
marcochavezf Mar 2, 2023
345c826
state picker completion
Prince-Mendiratta Feb 21, 2023
9cc42b2
country picker completion
Prince-Mendiratta Feb 21, 2023
ace997e
check country code on reopen
Prince-Mendiratta Feb 24, 2023
85e38e5
use simple DS for country list
Prince-Mendiratta Feb 27, 2023
3341627
display full state name if outside USA address
Prince-Mendiratta Feb 27, 2023
25c969a
move state input to new line
Prince-Mendiratta Feb 27, 2023
85427de
update country names
Prince-Mendiratta Feb 27, 2023
7a19455
backward compatibility of country name
Prince-Mendiratta Feb 28, 2023
41ce0e1
use underscorejs
Prince-Mendiratta Mar 1, 2023
8651063
more comments
Prince-Mendiratta Mar 2, 2023
740adee
fixed the rest of the arrows
JediWattson Mar 4, 2023
7ecfdb2
Merge branch 'Expensify:main' into arrow-feature-signed
JediWattson Mar 4, 2023
1c3cbe0
Make status bar transparent on android
janicduplessis Mar 4, 2023
f4c94d8
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Mar 4, 2023
a90a003
refactor onSubmit
Prince-Mendiratta Mar 5, 2023
8bc100b
fix issue where reactions won't re-render
hannojg Mar 5, 2023
e9ba4f5
temp fix toggling reactions is broken
hannojg Mar 5, 2023
55834f6
fix removing reactions causing artefacts
hannojg Mar 5, 2023
1cb6d60
fix regression where mini menu items weren't displaying correctly
hannojg Mar 5, 2023
516ef3a
fix: don't remove reactions when editing a message
hannojg Mar 5, 2023
253b981
getMostRecentIOuActionReportID should only check for requests
Julesssss Mar 6, 2023
2933b88
improve function name after modification
Julesssss Mar 6, 2023
40ad35a
replace IOU create string with existing const
Julesssss Mar 6, 2023
e6d3537
update comments for more clarity
Prince-Mendiratta Mar 6, 2023
1435ec3
Merge branch 'main' into jules-fixSendMoneyIOUPreviewBug
Julesssss Mar 6, 2023
61024b6
use correct equal check syntax
Julesssss Mar 6, 2023
adb6e7d
expose hasAccountIDReacted
hannojg Mar 6, 2023
debe8ad
apply code suggestion
hannojg Mar 6, 2023
8ed9e99
Update src/libs/actions/Report.js
hannojg Mar 6, 2023
d8fa085
apply code suggestion
hannojg Mar 6, 2023
da0e536
apply code suggestion
hannojg Mar 6, 2023
5b2c512
apply code suggestion
hannojg Mar 6, 2023
5842cf7
apply code suggestion
hannojg Mar 6, 2023
952fe98
remove unnecessary requestLayoutAnimation
hannojg Mar 6, 2023
dd48b96
added translations
hannojg Mar 6, 2023
c7c3411
match text
hannojg Mar 6, 2023
db1026a
reflect preferred skin tone in the rest of the UI
hannojg Mar 6, 2023
5e7e7c1
fixed bug where mini context menu wouldn't close
hannojg Mar 6, 2023
b73de4b
fix: make emojis in quick reaction unselectable
hannojg Mar 6, 2023
5db0b1f
fix: immediately remove reaction bar when no reactions are present an…
hannojg Mar 6, 2023
231fb63
fix tests
hannojg Mar 6, 2023
3fc8169
Merge branch 'main' into arrow-feature-signed
JediWattson Mar 6, 2023
96d55ae
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Mar 6, 2023
662c8ef
fix warning
hannojg Mar 6, 2023
f45dfeb
suppress eslint warning
hannojg Mar 6, 2023
91dc75f
remove unused default props
hannojg Mar 6, 2023
817168d
filter visibility options, add visibility descriptions
jasperhuangg Mar 6, 2023
e7790de
remove unused
jasperhuangg Mar 6, 2023
17e1fd1
enhancing loading when changing urls
JediWattson Mar 6, 2023
9e178e2
removed redundant call
JediWattson Mar 6, 2023
483a8b7
added back some functions, made sure redundant do not happen
JediWattson Mar 6, 2023
0d0c20d
use lodash for checking valid country code
Prince-Mendiratta Mar 6, 2023
5a62b43
remove focusable prop as not needed on web
hannojg Mar 6, 2023
1e5c971
add tooltip
hannojg Mar 6, 2023
cd93903
fix key issue
hannojg Mar 6, 2023
2c37fe3
Merge branch 'main' into jules-fixSendMoneyIOUPreviewBug
Julesssss Mar 7, 2023
b1dd65d
improve property lookup with lodash
Julesssss Mar 7, 2023
17cf77e
Merge pull request #15392 from Expensify/marco-addLeaveRoomAction
jasperhuangg Mar 7, 2023
d743e91
Remove `RequestCallPage` and `actions/Inbox.js`
francoisl Mar 7, 2023
28882a6
Remove remaining unused code
francoisl Mar 7, 2023
e678132
Remove `isPositiveInteger`
francoisl Mar 7, 2023
40c199b
Merge pull request #15718 from Expensify/francois-removeRequestCallPage
neil-marcellini Mar 7, 2023
5c27761
conditionally add left margin
luacmartins Mar 7, 2023
6520062
fix focusable prop
hannojg Mar 7, 2023
6c449d9
Fix publicDescription spanish translation
jasperhuangg Mar 7, 2023
d63a77b
rename to openContextMenu and shouldKeepOpen
hannojg Mar 7, 2023
9289fbd
use pr number variable
luacmartins Mar 7, 2023
e332259
Revert "TEMP: REMOVE ME once accountID on personal details is live"
hannojg Mar 7, 2023
effd5f4
add container styles back
hannojg Mar 7, 2023
840e381
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Mar 7, 2023
83e85f3
fix link syntax
luacmartins Mar 7, 2023
f08ec33
Revert "Fix the content-type for AASA"
marcochavezf Mar 7, 2023
dd5b07c
skip reactions for IOU messages for now
hannojg Mar 7, 2023
5cfbea4
Merge pull request #15727 from Expensify/revert-15708-jpersaud_fix_io…
marcochavezf Mar 7, 2023
7e8e8a1
Merge pull request #15726 from Expensify/cmartins-fixTestBuildLinks
cead22 Mar 7, 2023
e8d66c9
Update src/languages/es.js
jasperhuangg Mar 8, 2023
a34c4a7
Merge pull request #15507 from Prince-Mendiratta/locale-countries
Beamanator Mar 8, 2023
7af1573
fix focus on AddReactionBubble
hannojg Mar 8, 2023
baa93cc
fix safari selection bug
hannojg Mar 8, 2023
47e7c3d
Merge pull request #15677 from Expensify/jules-fixSendMoneyIOUPreviewBug
Julesssss Mar 8, 2023
730054f
Merge pull request #15339 from Expensify/cmartins-fixIsIOUOwnedByCurr…
Gonals Mar 8, 2023
9b8e1ac
fix adding multiple times the same reaction
hannojg Mar 8, 2023
e6d828d
Update version to 1.2.80-1
OSBotify Mar 8, 2023
e2a7592
Merge pull request #15738 from Expensify/version-BUILD-9BFA611C-8090-…
OSBotify Mar 8, 2023
28bda4d
Merge pull request #15522 from redstar504/Brayden-TooltipIssue
iwiznia Mar 8, 2023
cf87317
add public-read ACL
justinpersaud Mar 8, 2023
9e3596f
check specifically for undefined
hannojg Mar 8, 2023
f4ffc7c
Merge pull request #15210 from margelo/hanno/feat-add-remove-reactions
stitesExpensify Mar 8, 2023
618ce68
Merge pull request #15656 from janicduplessis/@janic/status-bar
bondydaa Mar 8, 2023
cb2ba26
Merge pull request #9279 from JediWattson/arrow-feature-signed
luacmartins Mar 8, 2023
878075f
Merge branch 'main' into jpersaud_ios_deeplink
marcochavezf Mar 8, 2023
4003f58
Merge pull request #15743 from Expensify/jpersaud_ios_deeplink
marcochavezf Mar 8, 2023
fb20144
Merge pull request #15721 from Expensify/jasper-fixPublicDescriptionT…
marcochavezf Mar 8, 2023
29d271c
fix preferredEmojiSkinTone
perunt Mar 8, 2023
cb4fc3b
fixed the error when putting the reaction directly on the link
perunt Mar 8, 2023
6b2a769
Merge pull request #15722 from Expensify/cmartins-alignHint
aldo-expensify Mar 8, 2023
46d6d40
update shouldShow
perunt Mar 8, 2023
df4ad8b
remove default value
perunt Mar 8, 2023
388d6a0
Merge pull request #15750 from margelo/perunt/reaction-fixes
stitesExpensify Mar 8, 2023
8444ae9
Revert "Show all Expensify logins in Contact Methods page & view each…
roryabraham Mar 9, 2023
87a87f3
Merge pull request #15761 from Expensify/revert-15204-beaman-showAllE…
francoisl Mar 9, 2023
59bcb04
Update version to 1.2.80-2
OSBotify Mar 9, 2023
2d5e7da
Merge pull request #15762 from Expensify/version-BUILD-13A145CC-D2B1-…
OSBotify Mar 9, 2023
11fd5c4
Update version to 1.2.81-0
OSBotify Mar 9, 2023
22cfc7a
Merge pull request #15765 from Expensify/version-PATCH-8FDED25F-AD05-…
OSBotify Mar 9, 2023
a46d916
Merge branch 'main' into update-staging-from-main
OSBotify Mar 9, 2023
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
Prev Previous commit
Next Next commit
Revert "Show all Expensify logins in Contact Methods page & view each…
… in new Contact Method Details page"
roryabraham authored Mar 9, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8444ae9590cb0ba1805550e9bac679ae2ab6b799
2 changes: 0 additions & 2 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
@@ -51,8 +51,6 @@ export default {
SETTINGS_PERSONAL_DETAILS_DATE_OF_BIRTH: `${SETTINGS_PERSONAL_DETAILS}/date-of-birth`,
SETTINGS_PERSONAL_DETAILS_ADDRESS: `${SETTINGS_PERSONAL_DETAILS}/address`,
SETTINGS_CONTACT_METHODS,
SETTINGS_CONTACT_METHOD_DETAILS: `${SETTINGS_CONTACT_METHODS}/:contactMethod/details`,
getEditContactMethodRoute: contactMethod => `${SETTINGS_CONTACT_METHODS}/${encodeURIComponent(contactMethod)}/details`,
NEW_GROUP: 'new/group',
NEW_CHAT: 'new/chat',
REPORT,
49 changes: 14 additions & 35 deletions src/components/AvatarWithIndicator.js
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ import {policyPropTypes} from '../pages/workspace/withPolicy';
import walletTermsPropTypes from '../pages/EnablePayments/walletTermsPropTypes';
import * as PolicyUtils from '../libs/PolicyUtils';
import * as PaymentMethods from '../libs/actions/PaymentMethods';
import * as UserUtils from '../libs/UserUtils';
import themeColors from '../styles/themes/default';

const propTypes = {
/** URL for the avatar */
@@ -28,8 +26,6 @@ const propTypes = {
/** To show a tooltip on hover */
tooltipText: PropTypes.string,

/* Onyx Props */

/** The employee list of all policies (coming from Onyx) */
policiesMemberList: PropTypes.objectOf(policyMemberPropType),

@@ -47,15 +43,6 @@ const propTypes = {

/** Information about the user accepting the terms for payments */
walletTerms: walletTermsPropTypes,

/** Login list for the user that is signed in */
loginList: PropTypes.shape({
/** Date login was validated, used to show info indicator status */
validatedDate: PropTypes.string,

/** Field-specific server side errors keyed by microtime */
errorFields: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),
}),
};

const defaultProps = {
@@ -67,50 +54,45 @@ const defaultProps = {
cardList: {},
userWallet: {},
walletTerms: {},
loginList: {},
};

const AvatarWithIndicator = (props) => {
const isLarge = props.size === 'large';
const indicatorStyles = [
styles.alignItemsCenter,
styles.justifyContentCenter,
isLarge ? styles.statusIndicatorLarge : styles.statusIndicator,
];

// If a policy was just deleted from Onyx, then Onyx will pass a null value to the props, and
// those should be cleaned out before doing any error checking
const cleanPolicies = _.pick(props.policies, policy => policy);
const cleanPolicyMembers = _.pick(props.policiesMemberList, member => member);

// All of the error & info-checking methods are put into an array. This is so that using _.some() will return
// early as soon as the first error / info condition is returned. This makes the checks very efficient since
// we only care if a single error / info condition exists anywhere.
// All of the error-checking methods are put into an array. This is so that using _.some() will return
// early as soon as the first error is returned. This makes the error checking very efficient since
// we only care if a single error exists anywhere.
const errorCheckingMethods = [
() => !_.isEmpty(props.userWallet.errors),
() => PaymentMethods.hasPaymentMethodError(props.bankAccountList, props.cardList),
() => _.some(cleanPolicies, PolicyUtils.hasPolicyError),
() => _.some(cleanPolicies, PolicyUtils.hasCustomUnitsError),
() => _.some(cleanPolicyMembers, PolicyUtils.hasPolicyMemberError),
() => UserUtils.hasLoginListError(props.loginList),

// Wallet term errors that are not caused by an IOU (we show the red brick indicator for those in the LHN instead)
() => !_.isEmpty(props.walletTerms.errors) && !props.walletTerms.chatReportID,
];
const infoCheckingMethods = [
() => UserUtils.hasLoginListInfo(props.loginList),
];
const shouldShowErrorIndicator = _.some(errorCheckingMethods, errorCheckingMethod => errorCheckingMethod());
const shouldShowInfoIndicator = !shouldShowErrorIndicator && _.some(infoCheckingMethods, infoCheckingMethod => infoCheckingMethod());

const indicatorColor = shouldShowErrorIndicator ? themeColors.danger : themeColors.success;
const indicatorStyles = [
styles.alignItemsCenter,
styles.justifyContentCenter,
styles.statusIndicator(indicatorColor),
];
const shouldShowIndicator = _.some(errorCheckingMethods, errorCheckingMethod => errorCheckingMethod());

return (
<View style={[styles.sidebarAvatar]}>
<View style={[isLarge ? styles.avatarLarge : styles.sidebarAvatar]}>
<Tooltip text={props.tooltipText}>
<Avatar
imageStyles={[isLarge ? styles.avatarLarge : null]}
source={props.source}
size={props.size}
/>
{(shouldShowErrorIndicator || shouldShowInfoIndicator) && (
{shouldShowIndicator && (
<View style={StyleSheet.flatten(indicatorStyles)} />
)}
</Tooltip>
@@ -141,7 +123,4 @@ export default withOnyx({
walletTerms: {
key: ONYXKEYS.WALLET_TERMS,
},
loginList: {
key: ONYXKEYS.LOGIN_LIST,
},
})(AvatarWithIndicator);
2 changes: 1 addition & 1 deletion src/components/MenuItem.js
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ const MenuItem = (props) => {
const descriptionTextStyle = StyleUtils.combineStyles([
styles.textLabelSupporting,
(props.icon ? styles.ml3 : undefined),
styles.breakWord,
styles.breakAll,
styles.lineHeightNormal,
], props.style);

16 changes: 0 additions & 16 deletions src/languages/en.js
Original file line number Diff line number Diff line change
@@ -119,8 +119,6 @@ export default {
youAppearToBeOffline: 'You appear to be offline.',
thisFeatureRequiresInternet: 'This feature requires an active internet connection to be used.',
areYouSure: 'Are you sure?',
verify: 'Verify',
yesContinue: 'Yes, continue',
zipCodeExample: 'e.g. 12345, 12345-1234, 12345 1234',
websiteExample: 'e.g. https://www.expensify.com',
},
@@ -346,20 +344,6 @@ export default {
contacts: {
contactMethod: 'Contact method',
contactMethods: 'Contact methods',
helpTextBeforeEmail: 'Add more ways for people to find you, and forward receipts to ',
helpTextAfterEmail: ' from multiple email addresses.',
pleaseVerify: 'Please verify this contact method',
getInTouch: "Whenever we need to get in touch with you, we'll use this contact method.",
enterMagicCode: ({contactMethod}) => `Please enter the magic code sent to ${contactMethod}`,
yourDefaultContactMethod: 'This is your current default contact method. You will not be able to delete this contact method until you set an alternative default by selecting another contact method and pressing “Set as default”.',
removeContactMethod: 'Remove contact method',
removeAreYouSure: 'Are you sure you want to remove this contact method? This action cannot be undone.',
resendMagicCode: 'Resend magic code',
genericFailureMessages: {
requestContactMethodValidateCode: 'Failed to send a new magic code. Please wait a bit and try again.',
validateSecondaryLogin: 'Failed to validate contact method with given magic code. Please request a new code and try again.',
deleteContactMethod: 'Failed to delete contact method. Please reach out to Concierge for help.',
},
},
pronouns: {
coCos: 'Co / Cos',
16 changes: 0 additions & 16 deletions src/languages/es.js
Original file line number Diff line number Diff line change
@@ -118,8 +118,6 @@ export default {
youAppearToBeOffline: 'Parece que estás desconectado.',
thisFeatureRequiresInternet: 'Esta función requiere una conexión a Internet activa para ser utilizada.',
areYouSure: '¿Estás seguro?',
verify: 'Verifique',
yesContinue: 'Sí, Continuar',
zipCodeExample: 'p. ej. 12345, 12345-1234, 12345 1234',
websiteExample: 'p. ej. https://www.expensify.com',
},
@@ -345,20 +343,6 @@ export default {
contacts: {
contactMethod: 'Método de contacto',
contactMethods: 'Métodos de contacto',
helpTextBeforeEmail: 'Añade más formas de que la gente te encuentre y reenvía los recibos a ',
helpTextAfterEmail: ' desde varias direcciones de correo electrónico.',
pleaseVerify: 'Por favor verifica este método de contacto',
getInTouch: 'Utilizaremos este método de contacto cuando necesitemos contactarte.',
enterMagicCode: ({contactMethod}) => `Por favor, introduce el código mágico enviado a ${contactMethod}`,
yourDefaultContactMethod: 'Este es tu método de contacto predeterminado. No podrás eliminarlo hasta que añadas otro método de contacto y lo marques como predeterminado pulsando "Establecer como predeterminado".',
removeContactMethod: 'Eliminar método de contacto',
removeAreYouSure: '¿Estás seguro de que quieres eliminar este método de contacto? Esta acción no se puede deshacer.',
resendMagicCode: 'Reenviar código mágico',
genericFailureMessages: {
requestContactMethodValidateCode: 'No se ha podido enviar un nuevo código mágico. Espera un rato y vuelve a intentarlo.',
validateSecondaryLogin: 'No se ha podido validar el método de contacto con el código mágico provisto. Solicita un nuevo código y vuelve a intentarlo.',
deleteContactMethod: 'No se ha podido eliminar el método de contacto. Por favor contacta con Concierge para obtener ayuda.',
},
},
pronouns: {
coCos: 'Co / Cos',
23 changes: 0 additions & 23 deletions src/libs/ErrorUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import _ from 'underscore';
import lodashGet from 'lodash/get';
import CONST from '../CONST';

/**
@@ -55,30 +54,8 @@ function getLatestErrorMessage(onyxData) {
.value();
}

/**
* @param {Object} onyxData
* @param {Object} onyxData.errorFields
* @param {String} fieldName
* @returns {Object}
*/
function getLatestErrorField(onyxData, fieldName) {
const errorsForField = lodashGet(onyxData, ['errorFields', fieldName], {});

if (_.isEmpty(errorsForField)) {
return {};
}
return _.chain(errorsForField)
.keys()
.sortBy()
.reverse()
.map(key => ({[key]: errorsForField[key]}))
.first()
.value();
}

export {
// eslint-disable-next-line import/prefer-default-export
getAuthenticateErrorMessage,
getLatestErrorMessage,
getLatestErrorField,
};
21 changes: 7 additions & 14 deletions src/libs/Navigation/AppNavigator/ModalStackNavigators.js
Original file line number Diff line number Diff line change
@@ -217,20 +217,6 @@ const SettingsModalStackNavigator = createModalStackNavigator([
},
name: 'Settings_Profile',
},
{
getComponent: () => {
const SettingsContactMethodDetailsPage = require('../../../pages/settings/Profile/Contacts/ContactMethodDetailsPage').default;
return SettingsContactMethodDetailsPage;
},
name: 'Settings_ContactMethodDetails',
},
{
getComponent: () => {
const SettingsContactMethodsPage = require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default;
return SettingsContactMethodsPage;
},
name: 'Settings_ContactMethods',
},
{
getComponent: () => {
const SettingsPronounsPage = require('../../../pages/settings/Profile/PronounsPage').default;
@@ -287,6 +273,13 @@ const SettingsModalStackNavigator = createModalStackNavigator([
},
name: 'Settings_PersonalDetails_Address',
},
{
getComponent: () => {
const SettingsContactMethodsPage = require('../../../pages/settings/Profile/Contacts/ContactMethodsPage').default;
return SettingsContactMethodsPage;
},
name: 'Settings_ContactMethods',
},
{
getComponent: () => {
const SettingsAddSecondaryLoginPage = require('../../../pages/settings/Profile/Contacts/AddSecondaryLoginPage').default;
3 changes: 0 additions & 3 deletions src/libs/Navigation/linkingConfig.js
Original file line number Diff line number Diff line change
@@ -124,9 +124,6 @@ export default {
path: ROUTES.SETTINGS_CONTACT_METHODS,
exact: true,
},
Settings_ContactMethodDetails: {
path: ROUTES.SETTINGS_CONTACT_METHOD_DETAILS,
},
Settings_Add_Secondary_Login: {
path: ROUTES.SETTINGS_ADD_LOGIN,
},
68 changes: 0 additions & 68 deletions src/libs/UserUtils.js

This file was deleted.

187 changes: 0 additions & 187 deletions src/libs/actions/User.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ import * as SequentialQueue from '../Network/SequentialQueue';
import PusherUtils from '../PusherUtils';
import * as Report from './Report';
import * as ReportActionsUtils from '../ReportActionsUtils';
import DateUtils from '../DateUtils';
import * as Session from './Session';

let currentUserAccountID = '';
@@ -101,61 +100,6 @@ function resendValidateCode(login) {
Session.resendValidateCode(login);
}

/**
* Requests a new validate code be sent for the passed contact method
*
* @param {String} contactMethod - the new contact method that the user is trying to verify
*/
function requestContactMethodValidateCode(contactMethod) {
const optimisticData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
validateCodeSent: true,
errorFields: {
validateCodeSent: null,
},
pendingFields: {
validateCodeSent: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
},
},
}];
const successData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
pendingFields: {
validateCodeSent: null,
},
},
},
}];
const failureData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
validateCodeSent: false,
errorFields: {
validateCodeSent: {
[DateUtils.getMicroseconds()]: Localize.translateLocal('contacts.genericFailureMessages.requestContactMethodValidateCode'),
},
},
pendingFields: {
validateCodeSent: null,
},
},
},
}];

API.write('RequestContactMethodValidateCode', {
email: contactMethod,
}, {optimisticData, successData, failureData});
}

/**
* Sets whether or not the user is subscribed to Expensify news
*
@@ -218,77 +162,6 @@ function setSecondaryLoginAndNavigate(login, password) {
});
}

/**
* Delete a specific contact method
*
* @param {String} contactMethod - the contact method being deleted
* @param {Object} oldLoginData
*/
function deleteContactMethod(contactMethod, oldLoginData) {
const optimisticData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
partnerUserID: '',
errorFields: {
deletedLogin: null,
},
pendingFields: {
deletedLogin: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
},
},
},
}];
const successData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: null,
},
}];
const failureData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
...oldLoginData,
errorFields: {
deletedLogin: {
[DateUtils.getMicroseconds()]: Localize.translateLocal('contacts.genericFailureMessages.deleteContactMethod'),
},
},
pendingFields: {
deletedLogin: null,
},
},
},
}];

API.write('DeleteContactMethod', {
partnerUserID: contactMethod,
}, {optimisticData, successData, failureData});
}

/**
* Clears any possible stored errors for a specific field on a contact method
*
* @param {String} contactMethod
* @param {String} fieldName
*/
function clearContactMethodErrors(contactMethod, fieldName) {
Onyx.merge(ONYXKEYS.LOGIN_LIST, {
[contactMethod]: {
errorFields: {
[fieldName]: null,
},
pendingFields: {
[fieldName]: null,
},
},
});
}

/**
* Validates a login given an accountID and validation code
*
@@ -314,62 +187,6 @@ function validateLogin(accountID, validateCode) {
Navigation.navigate(ROUTES.HOME);
}

/**
* Validates a secondary login / contact method
*
* @param {String} contactMethod - The contact method the user is trying to verify
* @param {String} validateCode
*/
function validateSecondaryLogin(contactMethod, validateCode) {
const optimisticData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
errorFields: {
validateLogin: null,
},
pendingFields: {
validateLogin: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},
},
},
}];
const successData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
pendingFields: {
validateLogin: null,
},
},
},
}];
const failureData = [{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.LOGIN_LIST,
value: {
[contactMethod]: {
errorFields: {
validateLogin: {
[DateUtils.getMicroseconds()]: Localize.translateLocal('contacts.genericFailureMessages.validateSecondaryLogin'),
},
},
pendingFields: {
validateLogin: null,
},
},
},
}];

API.write('ValidateSecondaryLogin', {
partnerUserID: contactMethod,
validateCode,
}, {optimisticData, successData, failureData});
Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHODS);
}

/**
* Checks the blockedFromConcierge object to see if it has an expiresAt key,
* and if so whether the expiresAt date of a user's ban is before right now
@@ -657,13 +474,9 @@ export {
updatePassword,
closeAccount,
resendValidateCode,
requestContactMethodValidateCode,
updateNewsletterSubscription,
setSecondaryLoginAndNavigate,
deleteContactMethod,
clearContactMethodErrors,
validateLogin,
validateSecondaryLogin,
isBlockedFromConcierge,
subscribeToUserEvents,
updatePreferredSkinTone,
16 changes: 1 addition & 15 deletions src/pages/settings/InitialSettingsPage.js
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@ import ConfirmModal from '../../components/ConfirmModal';
import * as ReportUtils from '../../libs/ReportUtils';
import * as Link from '../../libs/actions/Link';
import OfflineWithFeedback from '../../components/OfflineWithFeedback';
import * as UserUtils from '../../libs/UserUtils';

const propTypes = {
/* Onyx Props */
@@ -81,15 +80,6 @@ const propTypes = {
/** Information about the user accepting the terms for payments */
walletTerms: walletTermsPropTypes,

/** Login list for the user that is signed in */
loginList: PropTypes.shape({
/** Date login was validated, used to show brickroad info status */
validatedDate: PropTypes.string,

/** Field-specific server side errors keyed by microtime */
errorFields: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),
}),

...withLocalizePropTypes,
...withCurrentUserPersonalDetailsPropTypes,
};
@@ -155,7 +145,6 @@ class InitialSettingsPage extends React.Component {
.filter(policy => policy && policy.type === CONST.POLICY.TYPE.FREE && policy.role === CONST.POLICY.ROLE.ADMIN)
.find(policy => PolicyUtils.hasPolicyError(policy) || PolicyUtils.getPolicyBrickRoadIndicatorStatus(policy, this.props.policyMembers))
.value() ? 'error' : null;
const profileBrickRoadIndicator = UserUtils.getLoginListBrickRoadIndicator(this.props.loginList);

return ([
{
@@ -170,7 +159,6 @@ class InitialSettingsPage extends React.Component {
translationKey: 'common.profile',
icon: Expensicons.Profile,
action: () => { App.openProfile(); },
brickRoadIndicator: profileBrickRoadIndicator,
},
{
translationKey: 'common.preferences',
@@ -221,6 +209,7 @@ class InitialSettingsPage extends React.Component {
iconType={item.iconType}
onPress={item.action}
iconStyles={item.iconStyles}
iconFill={item.iconFill}
shouldShowRightIcon
iconRight={item.iconRight}
badgeText={this.getWalletBalance(isPaymentItem)}
@@ -351,9 +340,6 @@ export default compose(
walletTerms: {
key: ONYXKEYS.WALLET_TERMS,
},
loginList: {
key: ONYXKEYS.LOGIN_LIST,
},
}),
withNetwork(),
)(InitialSettingsPage);
257 changes: 0 additions & 257 deletions src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.js

This file was deleted.

179 changes: 75 additions & 104 deletions src/pages/settings/Profile/Contacts/ContactMethodsPage.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React from 'react';
import {View} from 'react-native';
import React, {Component} from 'react';
import {ScrollView} from 'react-native-gesture-handler';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import HeaderWithCloseButton from '../../../../components/HeaderWithCloseButton';
import ScreenWrapper from '../../../../components/ScreenWrapper';
import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsDefaultProps, withCurrentUserPersonalDetailsPropTypes} from '../../../../components/withCurrentUserPersonalDetails';
import withLocalize, {withLocalizePropTypes} from '../../../../components/withLocalize';
import CONST from '../../../../CONST';
import compose from '../../../../libs/compose';
import Navigation from '../../../../libs/Navigation/Navigation';
import ONYXKEYS from '../../../../ONYXKEYS';
import ROUTES from '../../../../ROUTES';
import LoginField from './LoginField';
import MenuItem from '../../../../components/MenuItem';
import Text from '../../../../components/Text';
import styles from '../../../../styles/styles';
import CopyTextToClipboard from '../../../../components/CopyTextToClipboard';
import OfflineWithFeedback from '../../../../components/OfflineWithFeedback';

const propTypes = {
/* Onyx Props */
@@ -32,136 +27,112 @@ const propTypes = {
/** Phone/Email associated with user */
partnerUserID: PropTypes.string,

/** Date login was validated, used to show brickroad info status */
/** Date of when login was validated */
validatedDate: PropTypes.string,

/** Field-specific server side errors keyed by microtime */
errorFields: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),

/** Field-specific pending states for offline UI status */
pendingFields: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),
}),

/** Current user session */
session: PropTypes.shape({
email: PropTypes.string.isRequired,
}).isRequired,

...withLocalizePropTypes,
...withCurrentUserPersonalDetailsPropTypes,
};

const defaultProps = {
loginList: {},
...withCurrentUserPersonalDetailsDefaultProps,
};

const ContactMethodsPage = (props) => {
let hasPhoneNumberLogin = false;
let hasEmailLogin = false;
class ContactMethodsPage extends Component {
constructor(props) {
super(props);

const loginMenuItems = _.map(props.loginList, (login, loginName) => {
const pendingAction = lodashGet(login, 'pendingFields.deletedLogin', null);
if (!login.partnerUserID && _.isEmpty(pendingAction)) {
return null;
}
this.state = {
logins: this.getLogins(),
};

let description = '';
if (props.session.email === login.partnerUserID) {
description = props.translate('contacts.getInTouch');
} else if (!login.validatedDate) {
description = props.translate('contacts.pleaseVerify');
}
let indicator = null;
if (_.some(lodashGet(login, 'errorFields', {}), errorField => !_.isEmpty(errorField))) {
indicator = CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR;
} else if (!login.validatedDate) {
indicator = CONST.BRICK_ROAD_INDICATOR_STATUS.INFO;
this.getLogins = this.getLogins.bind(this);
}

componentDidUpdate(prevProps) {
let stateToUpdate = {};

// Recalculate logins if loginList has changed
if (_.keys(this.props.loginList).length !== _.keys(prevProps.loginList).length) {
stateToUpdate = {logins: this.getLogins()};
}

// Temporary checks to determine if we need to show specific LoginField
// components. This check will be removed soon.
// Also we still use login.partnerUserID here even though it could have been
// deleted optimistically because if the deletion is pending, do want to show
// the option to add a new phone or email login, so we don't want to find
// that login type in the list here.
if (Str.isValidPhone(Str.removeSMSDomain(login.partnerUserID))) {
hasPhoneNumberLogin = true;
} else if (Str.isValidEmail(login.partnerUserID)) {
hasEmailLogin = true;
if (_.isEmpty(stateToUpdate)) {
return;
}

// Default to using login key if we deleted login.partnerUserID optimistically
// but still need to show the pending login being deleted while offline.
const partnerUserID = login.partnerUserID || loginName;
// eslint-disable-next-line react/no-did-update-set-state
this.setState(stateToUpdate);
}

/**
* Get the most validated login of each type
*
* @returns {Object}
*/
getLogins() {
return _.reduce(_.values(this.props.loginList), (logins, currentLogin) => {
const type = Str.isSMSLogin(currentLogin.partnerUserID) ? CONST.LOGIN_TYPE.PHONE : CONST.LOGIN_TYPE.EMAIL;
const login = Str.removeSMSDomain(currentLogin.partnerUserID);

// If there's already a login type that's validated and/or currentLogin isn't valid then return early
if ((login !== lodashGet(this.props.currentUserPersonalDetails, 'login')) && !_.isEmpty(logins[type])
&& (logins[type].validatedDate || !currentLogin.validatedDate)) {
return logins;
}
return {
...logins,
[type]: {
...currentLogin,
type,
partnerUserID: Str.removeSMSDomain(currentLogin.partnerUserID),
},
};
}, {
phone: {},
email: {},
});
}

render() {
return (
<OfflineWithFeedback
pendingAction={pendingAction}
key={partnerUserID}
>
<MenuItem
title={Str.removeSMSDomain(partnerUserID)}
description={description}
onPress={() => Navigation.navigate(ROUTES.getEditContactMethodRoute(partnerUserID))}
brickRoadIndicator={indicator}
shouldShowBasicTitle
shouldShowRightIcon
disabled={!_.isEmpty(pendingAction)}
<ScreenWrapper>
<HeaderWithCloseButton
title={this.props.translate('contacts.contactMethods')}
shouldShowBackButton
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_PROFILE)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
</OfflineWithFeedback>
);
});

return (
<ScreenWrapper>
<HeaderWithCloseButton
title={props.translate('contacts.contactMethods')}
shouldShowBackButton
onBackButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_PROFILE)}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<ScrollView>
<View style={[styles.ph5, styles.mv3, styles.flexRow, styles.flexWrap]}>
<Text>
{props.translate('contacts.helpTextBeforeEmail')}
<CopyTextToClipboard
text="receipts@expensify.com"
textStyles={[styles.textBlue]}
/>
<Text>{props.translate('contacts.helpTextAfterEmail')}</Text>
</Text>
</View>
{loginMenuItems}
{/* The below fields will be removed soon, when we implement the new Add Contact Method page */}
{!hasEmailLogin && (
<ScrollView>
<LoginField
label={props.translate('profilePage.emailAddress')}
label={this.props.translate('profilePage.emailAddress')}
type="email"
login={{}}
login={this.state.logins.email}
defaultValue={this.state.logins.email}
/>
)}
{!hasPhoneNumberLogin && (
<LoginField
label={props.translate('common.phoneNumber')}
label={this.props.translate('common.phoneNumber')}
type="phone"
login={{}}
login={this.state.logins.phone}
defaultValue={this.state.logins.phone}
/>
)}
</ScrollView>
</ScreenWrapper>
);
};
</ScrollView>
</ScreenWrapper>
);
}
}

ContactMethodsPage.propTypes = propTypes;
ContactMethodsPage.defaultProps = defaultProps;
ContactMethodsPage.displayName = 'ContactMethodsPage';

export default compose(
withLocalize,
withCurrentUserPersonalDetails,
withOnyx({
loginList: {
key: ONYXKEYS.LOGIN_LIST,
},
session: {
key: ONYXKEYS.SESSION,
},
}),
)(ContactMethodsPage);
24 changes: 0 additions & 24 deletions src/pages/settings/Profile/ProfilePage.js
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@ import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import {ScrollView} from 'react-native-gesture-handler';
import _ from 'underscore';
import AvatarWithImagePicker from '../../../components/AvatarWithImagePicker';
@@ -22,21 +20,8 @@ import * as ReportUtils from '../../../libs/ReportUtils';
import ROUTES from '../../../ROUTES';
import styles from '../../../styles/styles';
import * as Expensicons from '../../../components/Icon/Expensicons';
import ONYXKEYS from '../../../ONYXKEYS';
import * as UserUtils from '../../../libs/UserUtils';

const propTypes = {
/* Onyx Props */

/** Login list for the user that is signed in */
loginList: PropTypes.shape({
/** Date login was validated, used to show brickroad info status */
validatedDate: PropTypes.string,

/** Field-specific server side errors keyed by microtime */
errorFields: PropTypes.objectOf(PropTypes.objectOf(PropTypes.string)),
}),

...withLocalizePropTypes,
...withCurrentUserPersonalDetailsPropTypes,
};
@@ -54,8 +39,6 @@ const ProfilePage = (props) => {
return lodashGet(props.translate('pronouns'), pronounsKey, props.translate('profilePage.selectYourPronouns'));
};
const currentUserDetails = props.currentUserPersonalDetails || {};
const contactMethodBrickRoadIndicator = UserUtils.getLoginListBrickRoadIndicator(props.loginList);

const profileSettingsOptions = [
{
description: props.translate('displayNamePage.headerTitle'),
@@ -66,7 +49,6 @@ const ProfilePage = (props) => {
description: props.translate('contacts.contactMethod'),
title: Str.removeSMSDomain(lodashGet(currentUserDetails, 'login', '')),
pageRoute: ROUTES.SETTINGS_CONTACT_METHODS,
brickRoadIndicator: contactMethodBrickRoadIndicator,
},
{
description: props.translate('pronounsPage.pronouns'),
@@ -112,7 +94,6 @@ const ProfilePage = (props) => {
title={detail.title}
description={detail.description}
onPress={() => Navigation.navigate(detail.pageRoute)}
brickRoadIndicator={detail.brickRoadIndicator}
/>
))}
</View>
@@ -134,9 +115,4 @@ ProfilePage.displayName = 'ProfilePage';
export default compose(
withLocalize,
withCurrentUserPersonalDetails,
withOnyx({
loginList: {
key: ONYXKEYS.LOGIN_LIST,
},
}),
)(ProfilePage);
27 changes: 22 additions & 5 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
@@ -1003,18 +1003,35 @@ const styles = {
width: variables.componentSizeNormal,
},

statusIndicator: (backgroundColor = themeColors.danger) => ({
statusIndicator: {
borderColor: themeColors.sidebar,
backgroundColor,
backgroundColor: themeColors.danger,
borderRadius: 6,
borderWidth: 2,
position: 'absolute',
right: -1,
bottom: -1,
height: 12,
width: 12,
zIndex: 10,
},

statusIndicatorLarge: {
borderColor: themeColors.componentBG,
backgroundColor: themeColors.danger,
borderRadius: 8,
borderWidth: 2,
position: 'absolute',
right: -2,
top: -1,
right: 4,
bottom: 4,
height: 16,
width: 16,
zIndex: 10,
}),
},

statusIndicatorOnline: {
backgroundColor: themeColors.success,
},

avatarWithIndicator: {
errorDot: {
4 changes: 0 additions & 4 deletions src/styles/utilities/spacing.js
Original file line number Diff line number Diff line change
@@ -201,10 +201,6 @@ export default {
marginBottom: 24,
},

mb7: {
marginBottom: 28,
},

mb8: {
marginBottom: 32,
},