A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
minor cleanup
ammarahm-ed5e49f6b4f51d
diff --git a/apps/mobile/src/components/Container/ContainerBottomButton.js b/apps/mobile/src/components/Container/ContainerBottomButton.jsindex 20fe9c6a2..f8378cfd5 100644--- a/apps/mobile/src/components/Container/ContainerBottomButton.js+++ b/apps/mobile/src/components/Container/ContainerBottomButton.js@@ -9,90 +9,80 @@ import {pv, SIZE, WEIGHT} from "../../utils/SizeUtils";import {DDS} from "../../services/DeviceDetection";export const ContainerBottomButton = ({title, onPress, color}) => {- const [state, dispatch] = useTracked();- const {colors} = state;- const [buttonHide, setButtonHide] = useState(false);- const insets = useSafeAreaInsets();+ const [state,] = useTracked();+ const {colors} = state;+ const [buttonHide, setButtonHide] = useState(false);+ const insets = useSafeAreaInsets();- useEffect(() => {- Keyboard.addListener('keyboardDidShow', () => {- setTimeout(() => {- if (DDS.isTab) return;- setButtonHide(true);- }, 300);- });- Keyboard.addListener('keyboardDidHide', () => {- setTimeout(() => {+ const onKeyboardHide = () => {if (DDS.isTab) return;setButtonHide(false);- }, 0);- });- return () => {- Keyboard.removeListener('keyboardDidShow', () => {- setTimeout(() => {- if (DDS.isTab) return;- setButtonHide(true);- }, 300);- });- Keyboard.removeListener('keyboardDidHide', () => {- setTimeout(() => {- if (DDS.isTab) return;- setButtonHide(false);- }, 0);- });- };- }, []);+ }++ const onKeyboardShow = () => {+ if (DDS.isTab) return;+ setButtonHide(true);+ }++ useEffect(() => {+ Keyboard.addListener('keyboardDidShow', onKeyboardShow);+ Keyboard.addListener('keyboardDidHide', onKeyboardHide);+ return () => {+ Keyboard.removeListener('keyboardDidShow', onKeyboardShow);+ Keyboard.removeListener('keyboardDidHide', onKeyboardHide);+ };+ }, []);- return (- <View- style={{- width: '100%',- opacity: buttonHide ? 0 : 1,- position: 'absolute',- paddingHorizontal: 12,- bottom: Platform.OS === 'ios' ? insets.bottom - 10 : insets.bottom + 20,- zIndex: 10,- transform: [- {- translateY: buttonHide ? 200 : 0,- },- ],- }}>- <PressableButton- testID={'container_bottom_btn'}- color={color || colors.accent}- selectedColor={color || colors.accent}- customStyle={{- ...getElevation(5),- }}- onPress={onPress}>+ return (<View- style={{- justifyContent: 'flex-start',- alignItems: 'center',- flexDirection: 'row',- width: '100%',- padding: pv,- borderRadius: 5,- paddingVertical: pv + 5,- }}>- <Icon- name={title === 'Clear all trash' ? 'delete' : 'plus'}- color="white"- size={SIZE.xl}- />- <Text- testID="container_bottom_btn_text"style={{- fontSize: SIZE.md,- color: 'white',- fontFamily: WEIGHT.regular,- textAlignVertical: 'center',+ width: '100%',+ opacity: buttonHide ? 0 : 1,+ position: 'absolute',+ paddingHorizontal: 12,+ bottom: Platform.OS === 'ios' ? insets.bottom - 10 : insets.bottom + 20,+ zIndex: 10,+ transform: [+ {+ translateY: buttonHide ? 200 : 0,+ },+ ],}}>- {' ' + title}- </Text>+ <PressableButton+ testID={'container_bottom_btn'}+ color={color || colors.accent}+ selectedColor={color || colors.accent}+ customStyle={{+ ...getElevation(5),+ }}+ onPress={onPress}>+ <View+ style={{+ justifyContent: 'flex-start',+ alignItems: 'center',+ flexDirection: 'row',+ width: '100%',+ padding: pv,+ borderRadius: 5,+ paddingVertical: pv + 5,+ }}>+ <Icon+ name={title === 'Clear all trash' ? 'delete' : 'plus'}+ color="white"+ size={SIZE.xl}+ />+ <Text+ testID="container_bottom_btn_text"+ style={{+ fontSize: SIZE.md,+ color: 'white',+ fontFamily: WEIGHT.regular,+ textAlignVertical: 'center',+ }}>+ {' ' + title}+ </Text>+ </View>+ </PressableButton></View>- </PressableButton>- </View>- );+ );};diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.jsindex 2c263d01c..c89bbc7c8 100644--- a/apps/mobile/src/components/Container/index.js+++ b/apps/mobile/src/components/Container/index.js@@ -1,18 +1,20 @@import React from 'react';import {KeyboardAvoidingView, Platform, SafeAreaView} from 'react-native';-import {initialWindowMetrics} from 'react-native-safe-area-context';+import {useSafeAreaInsets} from 'react-native-safe-area-context';import SelectionHeader from '../SelectionHeader';import {ContainerTopSection} from './ContainerTopSection';export const Container = ({children, root}) => {+ const insets = useSafeAreaInsets()+return (<KeyboardAvoidingViewbehavior="padding"- enabled={Platform.OS === 'ios' ? true : false}>+ enabled={Platform.OS === 'ios'}><SafeAreaViewstyle={{height: '100%',- paddingTop: initialWindowMetrics.insets.top || 0,+ paddingTop: insets.top,}}><SelectionHeader /><ContainerTopSection root={root} />diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.jsindex b1fd482b8..e248e649c 100644--- a/apps/mobile/src/views/Settings/index.js+++ b/apps/mobile/src/views/Settings/index.js@@ -453,6 +453,7 @@ export const Settings = ({navigation}) => {alignSelf: 'center',flexDirection: 'row',flexWrap: 'wrap',+ justifyContent: 'space-between',paddingHorizontal: 12,}}>{[@@ -462,10 +463,6 @@ export const Settings = ({navigation}) => {'#0560FF','#f58231','#911eb4',- '#46f0f0',- '#f032e6',- '#bcf60c',- '#fabebe',].map((item) => (<PressableButtonkey={item}@@ -489,10 +486,10 @@ export const Settings = ({navigation}) => {flexDirection: 'row',justifyContent: 'center',alignItems: 'center',- marginHorizontal: 5,marginVertical: 5,- width: DDS.isTab ? (dWidth * 0.28) / 5 - 35 : dWidth / 5 - 35,- height: DDS.isTab ? (dWidth * 0.28) / 5 - 35 : dWidth / 5 - 35,+ marginHorizontal: 0,+ width: DDS.isTab ? (dWidth * 0.28) / 5 - 24 : dWidth / 7.5,+ height: DDS.isTab ? (dWidth * 0.28) / 5 - 24 : dWidth / 7.5,borderRadius: 100,}}>{colors.accent === item ? (@@ -500,6 +497,49 @@ export const Settings = ({navigation}) => {) : null}</PressableButton>))}++ <View+ style={{+ width: '100%',+ flexDirection: 'row',+ flexWrap: 'wrap',+ }}>+ {['#46f0f0', '#f032e6', '#bcf60c', '#fabebe'].map((item,index) => (+ <PressableButton+ key={item}+ color={+ colors.accent === item+ ? RGB_Linear_Shade(+ !colors.night ? -0.2 : 0.2,+ hexToRGBA(item, 1),+ )+ : item+ }+ selectedColor={item}+ alpha={!colors.night ? -0.1 : 0.1}+ opacity={1}+ onPress={async () => {+ changeAccentColor(item);++ await MMKV.setStringAsync('accentColor', item);+ }}+ customStyle={{+ flexDirection: 'row',+ justifyContent: 'center',+ alignItems: 'center',+ marginTop: 5,+ marginRight: ((dWidth) - ((dWidth / 7.5) * 6))/12 ,+ marginLeft: index === 0 ? 0 : ((dWidth - 12) - ((dWidth / 7.5) * 6))/12.1 ,+ width: DDS.isTab ? (dWidth * 0.28) / 5 - 24 : dWidth / 7.5,+ height: DDS.isTab ? (dWidth * 0.28) / 5 - 24 : dWidth / 7.5,+ borderRadius: 100,+ }}>+ {colors.accent === item ? (+ <Icon size={SIZE.lg} color="white" name="check" />+ ) : null}+ </PressableButton>+ ))}+ </View></View><CustomButton@@ -575,7 +615,7 @@ export const Settings = ({navigation}) => {style={{fontSize: SIZE.sm,fontFamily: WEIGHT.regular,- color:colors.pri+ color: colors.pri,}}>{settings.homepage}</Text>@@ -585,7 +625,7 @@ export const Settings = ({navigation}) => {{MenuItemsList.map((item) => (<MenuItemonPress={() => {- setSetting(settings,'homepage',item.name);+ setSetting(settings, 'homepage', item.name);}}style={{backgroundColor:@@ -596,7 +636,10 @@ export const Settings = ({navigation}) => {textStyle={{fontFamily: WEIGHT.regular,fontSize: SIZE.sm,- color: settings.homepage === item.name ? colors.accent : colors.pri+ color:+ settings.homepage === item.name+ ? colors.accent+ : colors.pri,}}>{item.name}</MenuItem>