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.80-0 on staging #15716

Merged
merged 131 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
53f8351
Don't show the loading indicator if we're offline and restarted the b…
MariaHCD Feb 15, 2023
8d4b71e
New green brick indicator status
Beamanator Feb 16, 2023
8e2741e
New contact method details page
Beamanator Feb 16, 2023
af51025
Dynamically show all of a user's logins
Beamanator Feb 16, 2023
7f82353
Initial copy for contact methods page
Beamanator Feb 16, 2023
7889bae
Add new possible value for brickRoadIndicator
Beamanator Feb 16, 2023
4e8474b
Add key to array of items being rendered
Beamanator Feb 16, 2023
f097519
Populate contact method details page
Beamanator Feb 16, 2023
873bbc7
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Feb 21, 2023
5a1de67
New API call for deleting contact methods
Beamanator Feb 21, 2023
c2bd0ac
New function for clearing contact method errors
Beamanator Feb 21, 2023
8845a75
Show & connect remove button
Beamanator Feb 21, 2023
23fa444
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Feb 21, 2023
aeb85ff
Convert page to class for confirmation modal
Beamanator Feb 21, 2023
84cb98b
Fix hasPhoneNumberLogin check
Beamanator Feb 21, 2023
61a269f
wip: story for tooltip + render content
hannojg Feb 21, 2023
2ce661c
fix render tooltip size correctly
hannojg Feb 21, 2023
be3970c
formatting
hannojg Feb 21, 2023
1773f39
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Feb 22, 2023
a9698fd
New UI for magic code input form
Beamanator Feb 22, 2023
dc63b43
Fix for if we just removed a contact method
Beamanator Feb 22, 2023
a893888
A few new contact translations
Beamanator Feb 22, 2023
e960125
New command for requesting magic code for contact method
Beamanator Feb 22, 2023
a0ffda2
Move pages so page transitions look correct
Beamanator Feb 22, 2023
32f443c
Add validate contact method button
Beamanator Feb 22, 2023
748f3db
New command to validate a secondary login
Beamanator Feb 22, 2023
c44f11f
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Feb 23, 2023
73b95c9
Add generic failure message for delete contact method
Beamanator Feb 23, 2023
3f955bb
Lint, style, function fixes
Beamanator Feb 23, 2023
ffd616c
Show green checkmark after sending validate code
Beamanator Feb 23, 2023
3371ca0
Fix error & validate command params
Beamanator Feb 23, 2023
8ed002c
Show resend validate code error messages
Beamanator Feb 23, 2023
86cbead
There's no debugger here, psh
Beamanator Feb 23, 2023
b0bb26b
Fix how errors show
Beamanator Feb 23, 2023
a01cb83
Show pending deleted state
Beamanator Feb 24, 2023
15a96c5
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Feb 24, 2023
ca6f3b0
Adding missing spanish translations
Beamanator Feb 24, 2023
f63f420
Clean up some offline UI
Beamanator Feb 24, 2023
319807e
Show offline UI in menu items
Beamanator Feb 24, 2023
8dbd5b8
Address lint issues
Beamanator Feb 24, 2023
ba3cd0c
Copy updates
Beamanator Feb 24, 2023
3324da8
Sneaky little semicolon, i found you
Beamanator Feb 24, 2023
9fafefa
Fix edit message highlight issue
aneequeahmad Feb 24, 2023
346f8dc
Make function name make more sense
Beamanator Feb 27, 2023
96d6240
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Feb 27, 2023
3af0e1e
Clean up unused style
Beamanator Feb 27, 2023
7a883fc
Make status indicator color dynamic
Beamanator Feb 27, 2023
f17920a
Enable info indicator, remove unused large prop
Beamanator Feb 27, 2023
3b3e07a
Remove duplicate brick road status
Beamanator Feb 27, 2023
e20ea8f
Add login list utils for checking error / info status
Beamanator Feb 27, 2023
dfdaf8e
New util for getting loginList brick road color
Beamanator Feb 27, 2023
e43f2be
Integrate loginList brick road indicator
Beamanator Feb 27, 2023
3e542ee
Fix brick road indicator
Beamanator Feb 27, 2023
14869ac
modify util to return code and header
akshayasalvi Feb 27, 2023
6409401
update categorybar props and tooltip handling
akshayasalvi Feb 27, 2023
9751f8b
added the prop.code
akshayasalvi Feb 27, 2023
5210895
displace tooltip vertically
akshayasalvi Feb 27, 2023
175c09b
lint fixes
akshayasalvi Feb 27, 2023
4ab3256
refactor category bar imports
akshayasalvi Feb 27, 2023
cec2481
lint fixes
akshayasalvi Feb 27, 2023
5c77a03
Merge branch 'main' of github.com:akshayasalvi/App into emoji-categor…
akshayasalvi Feb 27, 2023
5802e4c
lint fixes
akshayasalvi Feb 27, 2023
1fe2268
Reset hover state to selected emoji
jatinsonijs Feb 28, 2023
d36088b
Fix up util params and returns
Beamanator Mar 1, 2023
a9ce025
Fix up loginList proptypes
Beamanator Mar 1, 2023
eee93f7
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Mar 1, 2023
6e57549
Fix delete login online & offline logic
Beamanator Mar 1, 2023
f2a3b34
Make eslint happy
Beamanator Mar 1, 2023
96b9f16
Local eslint didn't catch this!!
Beamanator Mar 1, 2023
25404bc
Merge branch 'main' of github.com:akshayasalvi/App into emoji-categor…
akshayasalvi Mar 1, 2023
a94568b
Allow searching for phone numbers with parenthesis, spaces and dashes…
narefyev91 Mar 1, 2023
52b0133
Make horizontal padding a bit smaller
Beamanator Mar 1, 2023
860137d
Don't show remove button for default contact method
Beamanator Mar 1, 2023
70b1d52
migrate to global solution
narefyev91 Mar 1, 2023
67ea1a5
change reg exp
narefyev91 Mar 1, 2023
e77d1bb
wrap pressable with tooltip
akshayasalvi Mar 1, 2023
f078abf
lint fixes
akshayasalvi Mar 1, 2023
7f97adf
updated comments
akshayasalvi Mar 1, 2023
d46da19
fix the tooltip alignment
akshayasalvi Mar 2, 2023
84ddd2f
styling update
akshayasalvi Mar 2, 2023
aa53ea8
add 2px spacing
akshayasalvi Mar 2, 2023
72b1ed5
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Mar 2, 2023
2b6b1b2
Fix long description word break style
Beamanator Mar 2, 2023
fea8a48
update spacing to 4px
akshayasalvi Mar 2, 2023
33e17d0
remove unused regexp
narefyev91 Mar 2, 2023
8690bd7
change namings for regexp
narefyev91 Mar 2, 2023
b466891
Add more spacing between verify form and delete btn
Beamanator Mar 2, 2023
e927f49
Make delete button icon red
Beamanator Mar 2, 2023
170d379
remove unused prop
Beamanator Mar 2, 2023
c5fab55
Make status indicator bigger and top right
Beamanator Mar 2, 2023
6b636ad
subscribe to keyboard event
luacmartins Mar 3, 2023
8bfa4b7
unsubscribe from event
luacmartins Mar 3, 2023
077849b
Merge branch 'main' of github.com:margelo/expensify-app-fork into han…
hannojg Mar 5, 2023
80a0bab
move logic for measuring tooltip content size to TooltipRendererdOnpa…
hannojg Mar 5, 2023
0d6fd7a
add default value
hannojg Mar 5, 2023
e646bfe
Set background color of locale picker to match page background
grgia Mar 6, 2023
cbf61fa
Remove border radius to work on all platforms including windows
grgia Mar 6, 2023
aef0e97
unify to updateTooltipContentWidth
hannojg Mar 6, 2023
c005817
clean: remove empty args
hannojg Mar 6, 2023
7e6c964
return promise
TMisiukiewicz Mar 6, 2023
49caf3f
Merge branch 'main' of github.com:Expensify/App into beaman-showAllEx…
Beamanator Mar 6, 2023
97ebafc
Address comments
Beamanator Mar 6, 2023
37a4d7d
a solution without width
hannojg Mar 6, 2023
73ad460
a solution with width
hannojg Mar 6, 2023
ace7d0a
Merge pull request #15594 from narefyev91/fix-phone-search
puneetlath Mar 6, 2023
43a90ce
Revert "a solution with width"
hannojg Mar 6, 2023
fa31c0f
Revert "a solution without width"
hannojg Mar 6, 2023
95cdfdb
Merge pull request #15513 from akshayasalvi/emoji-category-bar-tooltip
stitesExpensify Mar 6, 2023
8852f73
Merge pull request #15675 from Expensify/georgia-localPickerColor
techievivek Mar 6, 2023
e57fd78
changed to a simpler solution
hannojg Mar 6, 2023
17ddaa2
Remove unnecessary props
mountiny Mar 6, 2023
464c644
remove unnecessary fragment
hannojg Mar 6, 2023
b294069
clean
hannojg Mar 6, 2023
2eedb31
Merge pull request #15687 from Expensify/vit-removeUnnecessaryProps
luacmartins Mar 6, 2023
2c23614
Merge pull request #15482 from aneequeahmad/edit-composer-highlight-fix
chiragsalian Mar 6, 2023
97f2706
Remove two more DeprecatedAPI methods that are no longer used
yuwenmemon Mar 6, 2023
6413a79
Merge pull request #15552 from jatinsonijs/fix-two-skin-highlighted
stitesExpensify Mar 6, 2023
4905cd5
Merge pull request #15704 from TMisiukiewicz/fix/hanging-tests-action
mountiny Mar 7, 2023
18f98b3
Merge pull request #15691 from Expensify/yuwen-removeDeprecatedAPIMet…
madmax330 Mar 7, 2023
a7b6838
Merge pull request #15204 from Expensify/beaman-showAllExpensifyLogins
cristipaval Mar 7, 2023
71a119f
Merge pull request #15650 from Expensify/cmartins-escapeToClear
madmax330 Mar 7, 2023
9863204
log warning when trying to use both props
hannojg Mar 7, 2023
9914551
Fix the content-type for AASA
justinpersaud Mar 7, 2023
f58eac1
fix staging bucket name
justinpersaud Mar 7, 2023
8c3cf56
undo style changes
justinpersaud Mar 7, 2023
9b190e8
Merge pull request #15161 from Expensify/maria-offline-bank-account-r…
Julesssss Mar 7, 2023
74f4e3d
Merge pull request #15708 from Expensify/jpersaud_fix_ios_deeplink
marcochavezf Mar 7, 2023
28d15b1
Merge pull request #15325 from margelo/hanno/change-tooltip-accept-ge…
stitesExpensify Mar 7, 2023
1c9c013
Update version to 1.2.80-0
OSBotify Mar 7, 2023
b0827f4
Merge pull request #15715 from Expensify/version-PATCH-CCFE9BA5-AC1C-…
OSBotify Mar 7, 2023
bec706e
Merge branch 'main' into update-staging-from-main
OSBotify Mar 7, 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
4 changes: 2 additions & 2 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ jobs:

- name: Deploy production to S3
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://expensify-cash/
run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://expensify-cash/ && aws s3 cp --content-type 'application/json' --metadata-directive REPLACE s3://expensify-cash/.well-known/apple-app-site-association s3://expensify-cash/.well-known/apple-app-site-association

- name: Deploy staging to S3
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://staging-expensify-cash/
run: aws s3 cp --recursive --acl public-read "$GITHUB_WORKSPACE"/dist s3://staging-expensify-cash/ && aws s3 cp --content-type 'application/json' --metadata-directive REPLACE s3://staging-expensify-cash/.well-known/apple-app-site-association s3://staging-expensify-cash/.well-known/apple-app-site-association

- name: Purge production Cloudflare cache
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001027900
versionName "1.2.79-0"
versionCode 1001028000
versionName "1.2.80-0"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
17 changes: 17 additions & 0 deletions assets/emojis.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import Smiley from './images/emoji.svg';
import AnimalsAndNature from './images/emojiCategoryIcons/plant.svg';
import FoodAndDrink from './images/emojiCategoryIcons/hamburger.svg';
import TravelAndPlaces from './images/emojiCategoryIcons/plane.svg';
import Activities from './images/emojiCategoryIcons/soccer-ball.svg';
import Objects from './images/emojiCategoryIcons/light-bulb.svg';
import Symbols from './images/emojiCategoryIcons/peace-sign.svg';
import Flags from './images/emojiCategoryIcons/flag.svg';

/*
* This list is generated from the code here https://github.com/github/gemoji/blob/master/db/emoji.json
* Each code is then converted to hex by replacing the "U+" with "0x"
Expand Down Expand Up @@ -68,6 +77,7 @@ const emojis = [
{
code: 'smileysAndEmotion',
header: true,
icon: Smiley,
},
{
name: 'grinning',
Expand Down Expand Up @@ -6965,6 +6975,7 @@ const emojis = [
{
code: 'animalsAndNature',
header: true,
icon: AnimalsAndNature,
},
{
name: 'monkey_face',
Expand Down Expand Up @@ -8138,6 +8149,7 @@ const emojis = [
{
code: 'foodAndDrink',
header: true,
icon: FoodAndDrink,
},
{
name: 'grapes',
Expand Down Expand Up @@ -9315,6 +9327,7 @@ const emojis = [
{
code: 'travelAndPlaces',
header: true,
icon: TravelAndPlaces,
},
{
name: 'earth_africa',
Expand Down Expand Up @@ -11434,6 +11447,7 @@ const emojis = [
{
code: 'activities',
header: true,
icon: Activities,
},
{
name: 'jack_o_lantern',
Expand Down Expand Up @@ -12271,6 +12285,7 @@ const emojis = [
{
code: 'objects',
header: true,
icon: Objects,
},
{
name: 'eyeglasses',
Expand Down Expand Up @@ -14600,6 +14615,7 @@ const emojis = [
{
code: 'symbols',
header: true,
icon: Symbols,
},
{
name: 'atm',
Expand Down Expand Up @@ -16590,6 +16606,7 @@ const emojis = [
{
code: 'flags',
header: true,
icon: Flags,
},
{
name: 'checkered_flag',
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.2.79</string>
<string>1.2.80</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.2.79.0</string>
<string>1.2.80.0</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.2.79</string>
<string>1.2.80</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.79.0</string>
<string>1.2.80.0</string>
</dict>
</plist>
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.2.79-0",
"version": "1.2.80-0",
"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
3 changes: 2 additions & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ const CONST = {
US_PHONE_WITH_OPTIONAL_COUNTRY_CODE: /^(\+1)?\d{10}$/,
DIGITS_AND_PLUS: /^\+?[0-9]*$/,
PHONE_E164_PLUS: /^\+?[1-9]\d{1,14}$/,
PHONE_WITH_SPECIAL_CHARS: /^[+]*[(]{0,1}[0-9]{1,3}[)]{0,1}[-\s\\./0-9]{0,12}$/,
PHONE_WITH_SPECIAL_CHARS: /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/,
ALPHABETIC_CHARS: /[a-zA-Z]+/,
POSITIVE_INTEGER: /^\d+$/,
NON_ALPHA_NUMERIC: /[^A-Za-z0-9+]/g,
Expand All @@ -821,6 +821,7 @@ const CONST = {
EMOJIS: /[\p{Extended_Pictographic}\u200d\u{1f1e6}-\u{1f1ff}\u{1f3fb}-\u{1f3ff}\u{e0020}-\u{e007f}\u20E3\uFE0F]|[#*0-9]\uFE0F?\u20E3/gu,
TAX_ID: /^\d{9}$/,
NON_NUMERIC: /\D/g,
NON_NUMERIC_WITH_PLUS: /[^0-9+]/g,
EMOJI_NAME: /:[\w+-]+:/g,
EMOJI_SUGGESTIONS: /:[a-zA-Z0-9_+-]{1,40}$/,
AFTER_FIRST_LINE_BREAK: /\n.*/g,
Expand Down
2 changes: 2 additions & 0 deletions src/ROUTES.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ 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,
Expand Down
49 changes: 35 additions & 14 deletions src/components/AvatarWithIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ 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 */
Expand All @@ -26,6 +28,8 @@ 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),

Expand All @@ -43,6 +47,15 @@ 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 = {
Expand All @@ -54,45 +67,50 @@ 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-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.
// 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.
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 shouldShowIndicator = _.some(errorCheckingMethods, errorCheckingMethod => errorCheckingMethod());
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),
];

return (
<View style={[isLarge ? styles.avatarLarge : styles.sidebarAvatar]}>
<View style={[styles.sidebarAvatar]}>
<Tooltip text={props.tooltipText}>
<Avatar
imageStyles={[isLarge ? styles.avatarLarge : null]}
source={props.source}
size={props.size}
/>
{shouldShowIndicator && (
{(shouldShowErrorIndicator || shouldShowInfoIndicator) && (
<View style={StyleSheet.flatten(indicatorStyles)} />
)}
</Tooltip>
Expand Down Expand Up @@ -123,4 +141,7 @@ export default withOnyx({
walletTerms: {
key: ONYXKEYS.WALLET_TERMS,
},
loginList: {
key: ONYXKEYS.LOGIN_LIST,
},
})(AvatarWithIndicator);
51 changes: 18 additions & 33 deletions src/components/EmojiPicker/CategoryShortcutBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,33 @@ import PropTypes from 'prop-types';
import {View} from 'react-native';
import _ from 'underscore';
import styles from '../../styles/styles';
import FrequentlyUsed from '../../../assets/images/history.svg';
import Smiley from '../../../assets/images/emoji.svg';
import AnimalsAndNature from '../../../assets/images/emojiCategoryIcons/plant.svg';
import FoodAndDrink from '../../../assets/images/emojiCategoryIcons/hamburger.svg';
import TravelAndPlaces from '../../../assets/images/emojiCategoryIcons/plane.svg';
import Activities from '../../../assets/images/emojiCategoryIcons/soccer-ball.svg';
import Objects from '../../../assets/images/emojiCategoryIcons/light-bulb.svg';
import Symbols from '../../../assets/images/emojiCategoryIcons/peace-sign.svg';
import Flags from '../../../assets/images/emojiCategoryIcons/flag.svg';
import CategoryShortcutButton from './CategoryShortcutButton';
import getOperatingSystem from '../../libs/getOperatingSystem';
import CONST from '../../CONST';

const propTypes = {
/** The function to call when an emoji is selected */
onPress: PropTypes.func.isRequired,

/** The indices that the icons should link to */
headerIndices: PropTypes.arrayOf(PropTypes.number).isRequired,
/** The emojis consisting emoji code and indices that the icons should link to */
headerEmojis: PropTypes.arrayOf(PropTypes.shape({
code: PropTypes.string.isRequired,
index: PropTypes.number.isRequired,
icon: PropTypes.func.isRequired,
})).isRequired,
};

const CategoryShortcutBar = (props) => {
const icons = [Smiley, AnimalsAndNature, FoodAndDrink, TravelAndPlaces, Activities, Objects, Symbols, Flags];
const CategoryShortcutBar = props => (
<View style={[styles.pt2, styles.ph4, styles.flexRow]}>
{_.map(props.headerEmojis, (headerEmoji, i) => (
<CategoryShortcutButton
icon={headerEmoji.icon}
onPress={() => props.onPress(headerEmoji.index)}
key={`categoryShortcut${i}`}
code={headerEmoji.code}
/>
))}
</View>
);

// If the user has frequently used emojis, there will be 9 headers, otherwise there will be 8
// Or for Windows OS there will be 8 headers, otherwise there will be 7
if (props.headerIndices.length === 9 || (getOperatingSystem() === CONST.OS.WINDOWS && props.headerIndices.length === 8)) {
icons.unshift(FrequentlyUsed);
}

return (
<View style={[styles.pt2, styles.ph4, styles.flexRow]}>
{_.map(props.headerIndices, (headerIndex, i) => (
<CategoryShortcutButton
icon={icons[i]}
onPress={() => props.onPress(headerIndex)}
key={`categoryShortcut${i}`}
/>
))}
</View>
);
};
CategoryShortcutBar.propTypes = propTypes;
CategoryShortcutBar.displayName = 'CategoryShortcutBar';

Expand Down
Loading