Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

add ability to disable ActionIcon

ammarahm-ed6efcef843d2f
diff --git a/apps/mobile/src/components/ActionIcon/index.js b/apps/mobile/src/components/ActionIcon/index.js
index cbb0f10e4..dc364ecaa 100644
--- a/apps/mobile/src/components/ActionIcon/index.js
+++ b/apps/mobile/src/components/ActionIcon/index.js
@@ -2,7 +2,8 @@ import React from 'react';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {useTracked} from '../../provider';
import {PressableButton} from '../PressableButton';
-import {SIZE} from "../../utils/SizeUtils";
+import {SIZE} from '../../utils/SizeUtils';
+import {hexToRGBA, RGB_Linear_Shade} from '../../utils/ColorUtils';
export const ActionIcon = ({
onPress,
@@ -13,9 +14,10 @@ export const ActionIcon = ({
iconStyle = {},
left = 10,
right = 10,
- top=30,
- bottom=30,
+ top = 30,
+ bottom = 30,
testID,
+ disabled,
}) => {
const [state, dispatch] = useTracked();
const {colors} = state;
@@ -26,19 +28,27 @@ export const ActionIcon = ({
onPress={onPress}
hitSlop={{top: top, left: left, right: right, bottom: bottom}}
color="transparent"
+ disabled={disabled}
selectedColor={colors.nav}
alpha={!colors.night ? -0.02 : 0.02}
opacity={1}
customStyle={{
width: 40,
height: 40,
+ backgroundColor: disabled ? colors.bg : null,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 100,
...customStyle,
-
}}>
- <Icon name={name} style={iconStyle} color={color} size={size} />
+ <Icon
+ name={name}
+ style={iconStyle}
+ color={
+ disabled ? RGB_Linear_Shade(-0.05, hexToRGBA(colors.nav)) : color
+ }
+ size={size}
+ />
</PressableButton>
);
};