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 ui fixes
ammarahm-edebb39757b44c
diff --git a/apps/mobile/src/components/AddNotebookDialog/index.js b/apps/mobile/src/components/AddNotebookDialog/index.jsindex dbe0ff69b..8b0c7b5e1 100644--- a/apps/mobile/src/components/AddNotebookDialog/index.js+++ b/apps/mobile/src/components/AddNotebookDialog/index.js@@ -12,7 +12,7 @@ import Icon from 'react-native-vector-icons/Feather';import {db, DDS} from '../../../App';import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';import {ACTIONS} from '../../provider';-import {getElevation, ToastEvent, timeSince} from '../../utils/utils';+import {getElevation, ToastEvent} from '../../utils/utils';import {updateEvent} from '../DialogManager';let refs = [];diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.jsindex ff10c0580..edaf80933 100644--- a/apps/mobile/src/components/Container/index.js+++ b/apps/mobile/src/components/Container/index.js@@ -17,6 +17,10 @@ export const AnimatedSafeAreaView = Animatable.createAnimatableComponent(SafeAreaView,);+const AnimatedTouchableOpacity = Animatable.createAnimatableComponent(+ TouchableOpacity,+);+export const Container = ({children,bottomButtonOnPress,@@ -31,21 +35,25 @@ export const Container = ({useEffect(() => {Keyboard.addListener('keyboardDidShow', () => {- setButtonHide(true);+ setTimeout(() => {+ setButtonHide(true);+ }, 300);});Keyboard.addListener('keyboardDidHide', () => {setTimeout(() => {setButtonHide(false);- }, 100);+ }, 300);});return () => {Keyboard.removeListener('keyboardDidShow', () => {- setButtonHide(true);+ setTimeout(() => {+ setButtonHide(true);+ }, 300);});Keyboard.removeListener('keyboardDidHide', () => {setTimeout(() => {setButtonHide(false);- }, 100);+ }, 300);});};}, []);@@ -67,8 +75,11 @@ export const Container = ({}}>{children}- {buttonHide || noBottomButton ? null : (- <TouchableOpacity+ {noBottomButton ? null : (+ <AnimatedTouchableOpacity+ transition={['translateY', 'opacity']}+ useNativeDriver={true}+ duration={250}onPress={bottomButtonOnPress}activeOpacity={opacity}style={{@@ -83,6 +94,12 @@ export const Container = ({position: 'absolute',zIndex: 10,bottom: 10,+ opacity: buttonHide ? 0 : 1,+ transform: [+ {+ translateY: buttonHide ? 200 : 0,+ },+ ],}}><Viewstyle={{@@ -104,7 +121,7 @@ export const Container = ({{' ' + bottomButtonText}</Text></View>- </TouchableOpacity>+ </AnimatedTouchableOpacity>)}</KeyboardAvoidingView></AnimatedSafeAreaView>diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.jsindex 509ded602..2a70abd05 100644--- a/apps/mobile/src/components/Menu/index.js+++ b/apps/mobile/src/components/Menu/index.js@@ -6,6 +6,7 @@ import {Text,TouchableOpacity,View,+ DeviceEventEmitter,} from 'react-native';import FastStorage from 'react-native-fast-storage';import Icon from 'react-native-vector-icons/Feather';@@ -30,6 +31,8 @@ export const Menu = ({close = () => {}, hide, update = () => {}}) => {// todo+ let overlayRef;+function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {let newColors = setColorScheme(colors, accent);StatusBar.setBarStyle(newColors.night ? 'light-content' : 'dark-content');@@ -116,6 +119,19 @@ export const Menu = ({close = () => {}, hide, update = () => {}}) => {marginTop: Platform.OS == 'ios' ? 0 : StatusBar.currentHeight - 10,}}/>+ <View+ ref={ref => (overlayRef = ref)}+ onLayout={() => {+ DeviceEventEmitter.emit('sendOverlayViewRef', {ref: overlayRef});+ }}+ style={{+ height: '100%',+ width: '100%',+ position: 'absolute',+ zIndex: 999,+ backgroundColor: colors.bg,+ }}+ /><ScrollViewcontentContainerStyle={{minHeight: '80%'}}diff --git a/apps/mobile/src/components/NotebookItem/index.js b/apps/mobile/src/components/NotebookItem/index.jsindex 4960fe741..4366d20cf 100644--- a/apps/mobile/src/components/NotebookItem/index.js+++ b/apps/mobile/src/components/NotebookItem/index.js@@ -106,6 +106,7 @@ export const NotebookItem = ({{item && item.topics? item.topics.slice(1, 4).map(topic => (<View+ key={topic.dateCreated.toString() + topic.title}style={{borderRadius: 5,backgroundColor: colors.accent,@@ -167,18 +168,14 @@ export const NotebookItem = ({alignItems: 'center',marginTop: 5,}}>- <Icon- style={{width: 30}}- name="lock"- size={SIZE.xs}- color={colors.icon}- />- <Icon- style={{width: 30}}- name="star"- size={SIZE.xs}- color={colors.icon}- />+ {item.favorite ? (+ <Icon+ style={{width: 30}}+ name="star"+ size={SIZE.xs}+ color={colors.icon}+ />+ ) : null}<Textstyle={{diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.jsindex 4336da3b9..7d699a905 100755--- a/apps/mobile/src/views/Editor/index.js+++ b/apps/mobile/src/views/Editor/index.js@@ -20,11 +20,9 @@ import {TEMPLATE_EXIT,} from '../../components/DialogManager';import {EditorMenu} from '../../components/EditorMenu';-import {useTracked} from '../../provider';+import {useTracked, ACTIONS} from '../../provider';import {SideMenuEvent} from '../../utils/utils';import {AnimatedSafeAreaView} from '../Home';-const w = Dimensions.get('window').width;-const h = Dimensions.get('window').height;let EditorWebView;let note = {};@@ -37,20 +35,9 @@ const Editor = ({navigation}) => {const [state, dispatch] = useTracked();const {colors} = state;- ///- const updateDB = () => {};-// Local Stateconst [sidebar, setSidebar] = useState(DDS.isTab ? true : false);- const [noteProps, setNoteProps] = useState({- tags: [],- locked: false,- pinned: false,- favorite: false,- colors: [],- });-// FUNCTIONSconst post = value => EditorWebView.postMessage(value);@@ -72,8 +59,7 @@ const Editor = ({navigation}) => {timer = null;onChange(evt.nativeEvent.data);timer = setTimeout(() => {- saveNote(noteProps, true);- console.log('saved');+ saveNote(true);}, 1000);}};@@ -103,8 +89,8 @@ const Editor = ({navigation}) => {},dateCreated: timestamp,});- updateDB();- if (lockNote && noteProps.locked) {++ if (lockNote && db.getNote(timestamp).locked) {db.lockNote(timestamp, 'password');}};@@ -118,15 +104,6 @@ const Editor = ({navigation}) => {};const updateEditor = () => {- let props = {- tags: note.tags,- colors: note.colors,- pinned: note.pinned,- favorite: note.favorite,- locked: note.locked,- };- setNoteProps({...props});-post(JSON.stringify(note.content.delta));post(JSON.stringify({diff --git a/apps/mobile/src/views/Tags/index.js b/apps/mobile/src/views/Tags/index.jsindex 2d14fd705..e9964fe64 100644--- a/apps/mobile/src/views/Tags/index.js+++ b/apps/mobile/src/views/Tags/index.js@@ -12,98 +12,92 @@ const h = Dimensions.get('window').height;export const Tags = ({navigation}) => {const [state, dispatch] = useTracked();const {colors} = state;- let isFocused = useIsFocused();- if (!isFocused) {- console.log('block rerender');- return <></>;- } else {- return (- <SafeAreaView- style={{- height: '100%',- backgroundColor: colors.bg,- }}>- <Header canGoBack={false} heading="Tags" menu={true} />+ return (+ <SafeAreaView+ style={{+ height: '100%',+ backgroundColor: colors.bg,+ }}>+ <Header canGoBack={false} heading="Tags" menu={true} />- <View style={{width: '90%', alignSelf: 'center', height: '100%'}}>- <FlatList- style={{- height: '100%',- }}- contentContainerStyle={{- height: '100%',- }}- data={[]}- ListEmptyComponent={- <View+ <View style={{width: '90%', alignSelf: 'center', height: '100%'}}>+ <FlatList+ style={{+ height: '100%',+ }}+ contentContainerStyle={{+ height: '100%',+ }}+ data={[]}+ ListEmptyComponent={+ <View+ style={{+ height: '80%',+ width: '100%',+ alignItems: 'center',+ alignSelf: 'center',+ justifyContent: 'center',+ opacity: 0.8,+ }}>+ <TagsPlaceHolder colors={colors} />+ <Textstyle={{- height: '80%',- width: '100%',- alignItems: 'center',- alignSelf: 'center',- justifyContent: 'center',- opacity: 0.8,+ fontSize: SIZE.md,+ color: colors.icon,+ }}>+ Tags added to notes appear here+ </Text>+ <Text+ style={{+ fontSize: SIZE.sm,+ color: colors.icon,+ marginTop: 20,+ }}>+ No tags found+ </Text>+ </View>+ }+ renderItem={({item, index}) => (+ <View+ style={{+ flexDirection: 'row',+ justifyContent: 'flex-start',+ alignItems: 'center',+ margin: 5,+ paddingVertical: pv,+ borderBottomWidth: 1.5,+ borderBottomColor: colors.navbg,+ }}>+ <Text+ style={{+ fontFamily: WEIGHT.regular,+ fontSize: SIZE.md,+ color: colors.pri,}}>- <TagsPlaceHolder colors={colors} /><Textstyle={{- fontSize: SIZE.md,- color: colors.icon,+ color: colors.accent,}}>- Tags added to notes appear here+ #</Text>+ {item.slice(1)}++ {'\n'}<Textstyle={{- fontSize: SIZE.sm,+ fontSize: SIZE.xs,color: colors.icon,- marginTop: 20,}}>- No tags found- </Text>- </View>- }- renderItem={({item, index}) => (- <View- style={{- flexDirection: 'row',- justifyContent: 'flex-start',- alignItems: 'center',- margin: 5,- paddingVertical: pv,- borderBottomWidth: 1.5,- borderBottomColor: colors.navbg,- }}>- <Text- style={{- fontFamily: WEIGHT.regular,- fontSize: SIZE.md,- color: colors.pri,- }}>- <Text- style={{- color: colors.accent,- }}>- #- </Text>- {item.slice(1)}-- {'\n'}- <Text- style={{- fontSize: SIZE.xs,- color: colors.icon,- }}>- 10 notes- </Text>+ 10 notes</Text>- </View>- )}- />- </View>- </SafeAreaView>- );- }+ </Text>+ </View>+ )}+ />+ </View>+ </SafeAreaView>+ );};Tags.navigationOptions = {