@towsila/expo-ui-library 2.3.0 → 2.4.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towsila/expo-ui-library",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -14,6 +14,7 @@ type ButtonProps = {
14
14
  height?: number;
15
15
  loading?: boolean;
16
16
  borderColor?: string;
17
+ disabled?: boolean;
17
18
  };
18
19
 
19
20
 
@@ -27,14 +28,16 @@ export default function SharpButton({
27
28
  fontFamily = Fonts.montserrat.semiBold,
28
29
  height = 56,
29
30
  loading,
31
+ disabled= false,
30
32
  }: ButtonProps) {
31
33
  const { colors } = useAppTheme();
32
-
34
+ const isInactive = loading || disabled;
33
35
  return (
34
36
  <TouchableOpacity
35
37
  onPress={onPress}
36
38
  activeOpacity={0.8}
37
- disabled={loading}
39
+ disabled={isInactive}
40
+ style={{ opacity: disabled && !loading ? 0.5 : 1 }}
38
41
  >
39
42
  <SharpContainer height={height} bgColor={bgColor} borderColor={borderColor ?? colors.text.primary}>
40
43
  <View style={styles.contentContainer}>