Skip to content

Commit

Permalink
Add new styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed Mar 13, 2024
1 parent a2283c7 commit ad115be
Show file tree
Hide file tree
Showing 2 changed files with 13 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
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.cardBG,
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 ad115be

Please sign in to comment.