Skip to content

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

fix color of pressable buttons

ammarahm-ed783102a7a033
diff --git a/apps/mobile/src/components/PressableButton/index.js b/apps/mobile/src/components/PressableButton/index.js
index 900847613..c79f41180 100644
--- a/apps/mobile/src/components/PressableButton/index.js
+++ b/apps/mobile/src/components/PressableButton/index.js
@@ -1,7 +1,7 @@
-import React, { useState } from 'react';
+import React, {useState} from 'react';
import {Platform, Pressable} from 'react-native';
import {br, opacity} from '../../common/common';
-import { RGB_Linear_Shade, hexToRGBA } from '../../utils/utils';
+import {RGB_Linear_Shade, hexToRGBA} from '../../utils/utils';
export const PressableButton = ({
color,
@@ -11,12 +11,10 @@ export const PressableButton = ({
children,
onPress,
customStyle,
- alpha=-0.1,
- opacity=1,
- onLongPress
+ alpha = -0.1,
+ opacity = 1,
+ onLongPress,
}) => {
-
-
return (
<Pressable
activeOpacity={opacity}
@@ -24,15 +22,19 @@ export const PressableButton = ({
onLongPress={onLongPress}
style={({pressed}) => [
{
- backgroundColor:
- pressed ? RGB_Linear_Shade(alpha, hexToRGBA(selectedColor, opacity)) : color,
+ backgroundColor: pressed
+ ? RGB_Linear_Shade(alpha, hexToRGBA(selectedColor, opacity))
+ : color !== 'transparent'
+ ? hexToRGBA(color, opacity - 0.02)
+ : color,
width: '100%',
alignSelf: 'center',
borderRadius: br,
justifyContent: 'center',
alignItems: 'center',
marginBottom: 0,
- },customStyle
+ },
+ customStyle,
]}>
{children}
</Pressable>