Skip to content

Commit

Permalink
Merge pull request #38227 from Expensify/vit-fixEditBG
Browse files Browse the repository at this point in the history
[NoQA] Update the Avatar Edit icon border colour
  • Loading branch information
mountiny authored Mar 13, 2024
2 parents 54b0a7c + acd2b9e commit fa6bcc0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/AvatarWithImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type AvatarWithImagePickerProps = {
/** Additional style props for disabled picker */
disabledStyle?: StyleProp<ViewStyle>;

/** Additional style props for the edit icon */
editIconStyle?: StyleProp<ViewStyle>;

/** Executed once an image has been selected */
onImageSelected?: (file: File | CustomRNImageManipulatorResult) => void;

Expand Down Expand Up @@ -120,6 +123,7 @@ function AvatarWithImagePicker({
DefaultAvatar = () => null,
style,
disabledStyle,
editIconStyle,
pendingAction,
errors,
errorRowStyles,
Expand Down Expand Up @@ -323,7 +327,7 @@ function AvatarWithImagePicker({
)}
</View>
{!disabled && (
<View style={[styles.smallEditIcon, styles.smallAvatarEditIcon]}>
<View style={StyleSheet.flatten([styles.smallEditIcon, styles.smallAvatarEditIcon, editIconStyle])}>
<Icon
src={Expensicons.Pencil}
width={variables.iconSizeSmall}
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/InitialSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ function InitialSettingsPage({session, userWallet, bankAccountList, fundList, wa
originalFileName={currentUserDetails.originalFileName}
headerTitle={translate('profilePage.profileAvatar')}
fallbackIcon={currentUserDetails?.fallbackIcon}
editIconStyle={styles.smallEditIconAccount}
/>
</OfflineWithFeedback>
<Text
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
styles.alignItemsStart,
styles.sectionMenuItemTopDescription,
]}
editIconStyle={styles.smallEditIconWorkspace}
isUsingDefaultAvatar={!policy?.avatar ?? null}
onImageSelected={(file) => Policy.updateWorkspaceAvatar(policy?.id ?? '', file as File)}
onImageRemoved={() => Policy.deleteWorkspaceAvatar(policy?.id ?? '')}
Expand Down
9 changes: 8 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,6 @@ const styles = (theme: ThemeColors) =>
smallEditIcon: {
alignItems: 'center',
backgroundColor: theme.buttonDefaultBG,
borderColor: theme.appBG,
borderRadius: 20,
borderWidth: 3,
color: theme.textReversed,
Expand All @@ -3107,6 +3106,14 @@ const styles = (theme: ThemeColors) =>
justifyContent: 'center',
},

smallEditIconWorkspace: {
borderColor: theme.cardBG,
},

smallEditIconAccount: {
borderColor: theme.appBG,
},

smallAvatarEditIcon: {
position: 'absolute',
right: -8,
Expand Down

0 comments on commit fa6bcc0

Please sign in to comment.