Skip to content

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

fix selected color for pressable

ammarahm-ed38ac91a2e603
diff --git a/apps/mobile/src/components/PressableButton/index.js b/apps/mobile/src/components/PressableButton/index.js
index 393ea1c5d..d86cfdaad 100644
--- a/apps/mobile/src/components/PressableButton/index.js
+++ b/apps/mobile/src/components/PressableButton/index.js
@@ -27,7 +27,9 @@ export const PressableButton = ({
accentColor = 'accent',
accentText = 'light',
customColor,
- customSelectedColor
+ customSelectedColor,
+ customAlpha,
+ customOpacity
}) => {
const [state] = useTracked();
const {colors} = state;
@@ -43,8 +45,8 @@ export const PressableButton = ({
? BUTTON_TYPES[type](accentColor, accentText).primary
: BUTTON_TYPES[type].primary
];
- const opacity = type === 'accent' ? 1 : BUTTON_TYPES[type].opacity;
- const alpha = colors.night ? 0.04 : -0.04;
+ const opacity = customOpacity ? customOpacity : type === 'accent' ? 1 : BUTTON_TYPES[type].opacity;
+ const alpha = customAlpha? customAlpha : colors.night ? 0.04 : -0.04;
const getStyle = useCallback(
({pressed}) => [
diff --git a/apps/mobile/src/components/SelectionWrapper/index.js b/apps/mobile/src/components/SelectionWrapper/index.js
index 9997c987a..f08bce228 100644
--- a/apps/mobile/src/components/SelectionWrapper/index.js
+++ b/apps/mobile/src/components/SelectionWrapper/index.js
@@ -78,9 +78,9 @@ const SelectionWrapper = ({
testID={testID}
onLongPress={onLongPress}
onPress={onPress}
- customSelectedColor={currentEditingNote ? colors.accent : colors.nav}
- alpha={!colors.night ? -0.02 : 0.02}
- opacity={currentEditingNote ? 0.15 : 1}
+ customSelectedColor={currentEditingNote === item.id ? colors.accent : colors.nav}
+ customAlpha={!colors.night ? -0.02 : 0.02}
+ customOpacity={currentEditingNote ? 0.15 : 1}
customStyle={{
flexDirection: 'row',
justifyContent: 'space-between',