-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch react-native-user-avatar@1.0.8 for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-user-avatar/src/index.js b/node_modules/react-native-user-avatar/src/index.js
index 170bad8..105c65b 100644
--- a/node_modules/react-native-user-avatar/src/index.js
+++ b/node_modules/react-native-user-avatar/src/index.js
@@ -17,18 +17,26 @@ import {
const UserAvatar = (props) => {
let {
- name,
+ name = 'John Doe',
src,
bgColor,
- bgColors,
- textColor,
- size,
+ bgColors = [ // from https://flatuicolors.com/
+ '#2ecc71', // emerald
+ '#3498db', // peter river
+ '#8e44ad', // wisteria
+ '#e67e22', // carrot
+ '#e74c3c', // alizarin
+ '#1abc9c', // turquoise
+ '#2c3e50', // midnight blue
+ ],
+ textColor = '#fff',
+ size = 32,
imageStyle,
style,
borderRadius,
component,
noUpperCase,
- textStyle,
+ textStyle = {},
} = props;
// Validations
@@ -91,21 +99,7 @@ UserAvatar.propTypes = {
textStyle: PropTypes.object,
};
-UserAvatar.defaultProps = {
- size: 32,
- textColor: '#fff',
- name: 'John Doe',
- bgColors: [ // from https://flatuicolors.com/
- '#2ecc71', // emerald
- '#3498db', // peter river
- '#8e44ad', // wisteria
- '#e67e22', // carrot
- '#e74c3c', // alizarin
- '#1abc9c', // turquoise
- '#2c3e50', // midnight blue
- ],
- textStyle: {},
-};
+
export {generateBackgroundColor};
This issue body was partially generated by patch-package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels