@fto-consult/expo-ui 7.12.1 → 7.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -59,6 +59,7 @@ const ButtonComponent = React.forwardRef((prs,ref) => {
|
|
59
59
|
noMargin,
|
60
60
|
isAlert,
|
61
61
|
borderRadius,
|
62
|
+
forceWhiteColorOnDarkMode,
|
62
63
|
...rest
|
63
64
|
} = prs;
|
64
65
|
isCancelButton = isCancelButton || error && true || false;
|
@@ -157,8 +158,8 @@ const ButtonComponent = React.forwardRef((prs,ref) => {
|
|
157
158
|
backgroundColor = Colors.isValid(style.backgroundColor)?style.backgroundColor : Colors.isValid(backgroundColor)? backgroundColor : isCancelButton ? style.backgroundColor = theme.colors.error : undefined;
|
158
159
|
borderColor = Colors.isValid(style.borderColor)? style.borderColor : isCancelButton ? theme.styles.onError : Colors.isValid(borderColor)? borderColor : undefined;
|
159
160
|
}
|
160
|
-
if(theme.isDark() && !hasElevation){
|
161
|
-
|
161
|
+
if(theme.isDark() && forceWhiteColorOnDarkMode !== false && !hasElevation){
|
162
|
+
textColor = white;
|
162
163
|
}
|
163
164
|
|
164
165
|
const rippleColor = Colors.setAlpha(textColor,0.32);
|
@@ -451,6 +452,7 @@ ButtonComponent.propTypes = {
|
|
451
452
|
iconPosition : PropTypes.oneOf([
|
452
453
|
'top','left','bottom','right'
|
453
454
|
]),
|
455
|
+
forceWhiteColorOnDarkMode: PropTypes.bool,//spécifie si la couleur white sera établie comme par défaut eu mode dark
|
454
456
|
}
|
455
457
|
|
456
458
|
export const setIsLoading = (buttonRef,loading)=>{
|
@@ -459,7 +459,7 @@ export const RecordingButton = function({onPress,testID,...props}){
|
|
459
459
|
const color = theme.Colors.setAlpha(theme.colors.text,theme.ALPHA);
|
460
460
|
const buttonContainerProps = {style:[theme.styles.w100,theme.styles.alignItemsFlexStart]}
|
461
461
|
return <View testID={testID+"_Container"} {...buttonContainerProps}>
|
462
|
-
<Button containerProps = {buttonContainerProps} {...props} style={[{color},buttonContainerProps.style,props.style]} upperCase={false} onPress = {(...args)=>{
|
462
|
+
<Button forceWhiteColorOnDarkMode={false} containerProps = {buttonContainerProps} {...props} style={[{color},buttonContainerProps.style,props.style]} upperCase={false} onPress = {(...args)=>{
|
463
463
|
if(onPress && onPress(...args) === false) return;
|
464
464
|
handleCapture();
|
465
465
|
}}
|
@@ -96,22 +96,6 @@ const useGetItems = (options)=>{
|
|
96
96
|
items[item.drawerSection.trim()].items.push(item);
|
97
97
|
}
|
98
98
|
});
|
99
|
-
if(handleHelp){
|
100
|
-
const dHelp = isObj(items.help)? Object.clone(items.help) : {};
|
101
|
-
items.help = {
|
102
|
-
key : 'help',
|
103
|
-
label : 'Aide',
|
104
|
-
section : true,
|
105
|
-
divider : false,
|
106
|
-
...dHelp,
|
107
|
-
items : Array.isArray(dHelp.items)? dHelp.items : [],
|
108
|
-
};
|
109
|
-
items.help.items.push({
|
110
|
-
icon : 'help',
|
111
|
-
label : 'A propos de '+APP.getName(),
|
112
|
-
routeName : aboutScreenName,
|
113
|
-
});
|
114
|
-
}
|
115
99
|
const dashboard = isObj(items.dashboard) ? Object.clone(items.dashboard) : {};
|
116
100
|
const dash = {
|
117
101
|
icon : 'view-dashboard',
|
@@ -134,16 +118,36 @@ const useGetItems = (options)=>{
|
|
134
118
|
delete items[section];
|
135
119
|
}
|
136
120
|
});
|
121
|
+
let hasCapture = false;
|
137
122
|
const captureSide = {
|
138
123
|
label : <RecordingButton/>,
|
139
124
|
style : [theme.styles.noPadding],
|
140
125
|
labelProps : {style : [{flexShrink : 1},theme.styles.alignItemsFlexStart,theme.styles.w100]}
|
141
126
|
};
|
142
|
-
if(
|
143
|
-
items.help
|
144
|
-
items.help
|
145
|
-
|
146
|
-
|
127
|
+
if(handleHelp){
|
128
|
+
const dHelp = isObj(items.help)? Object.clone(items.help) : {};
|
129
|
+
items.help = {
|
130
|
+
key : 'help',
|
131
|
+
label : 'Aide',
|
132
|
+
section : true,
|
133
|
+
divider : false,
|
134
|
+
...dHelp,
|
135
|
+
items : Array.isArray(dHelp.items)? dHelp.items : [],
|
136
|
+
};
|
137
|
+
items.help.items.push(captureSide,{
|
138
|
+
icon : 'help',
|
139
|
+
label : 'A propos de '+APP.getName(),
|
140
|
+
routeName : aboutScreenName,
|
141
|
+
});
|
142
|
+
hasCapture = true;
|
143
|
+
}
|
144
|
+
if(!hasCapture){
|
145
|
+
if(isObj(items.help) && Array.isArray(items.help.items)){
|
146
|
+
items.help = Object.clone(items.help);
|
147
|
+
items.help.items.push(captureSide);
|
148
|
+
} else {
|
149
|
+
items.desktopCapturer = captureSide;
|
150
|
+
}
|
147
151
|
}
|
148
152
|
return items;
|
149
153
|
},[showProfilOnDrawer,handleHelp,theme.name,theme.colors.primary,theme.colors.secondary,refreshItemsRef.current,force,isSignedIn])
|