Skip to content

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

cleanup

ammarahm-ed8177cf86ba5e
diff --git a/apps/mobile/src/components/ListItem/index.js b/apps/mobile/src/components/ListItem/index.js
deleted file mode 100644
index 10dbed318..000000000
--- a/apps/mobile/src/components/ListItem/index.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import React from 'react';
-import {Dimensions, Platform, Text, TouchableOpacity, View} from 'react-native';
-import {FlatList} from 'react-native-gesture-handler';
-import Icon from 'react-native-vector-icons/Ionicons';
-import {br, ph, pv, SIZE, WEIGHT} from '../../common/common';
-import {useTracked} from '../../provider';
-import {getElevation} from '../../utils/utils';
-const w = Dimensions.get('window').width;
-const h = Dimensions.get('window').height;
-export const ListItem = props => {
- const [state, dispatch] = useTracked();
- const {colors} = state;
-
- return (
- <View
- style={{
- ...getElevation(10),
- width: '90%',
- marginVertical: Platform.OS === 'ios' ? h * 0.01 : '0%',
- alignSelf: 'center',
- borderRadius: br,
- backgroundColor: colors.nav,
-
- marginBottom: 20,
- padding: 5,
- }}>
- <View>
- <View
- style={{
- width: '100%',
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- paddingHorizontal: ph,
- }}>
- <Text
- numberOfLines={1}
- style={{
- color: colors.pri,
- fontSize: SIZE.md,
- fontFamily: WEIGHT.bold,
- maxWidth: '100%',
- }}>
- Shopping List
- </Text>
-
- <View
- style={{
- width: '20%',
- justifyContent: 'space-between',
- flexDirection: 'row',
- alignItems: 'center',
- }}>
- <Icon name="md-share-alt" size={SIZE.lg} color={colors.icon} />
- <Icon name="md-star" size={SIZE.lg} color={colors.icon} />
- <Icon name="md-more" size={SIZE.lg} color={colors.icon} />
- </View>
- </View>
-
- <View>
- <FlatList
- data={['1 kg wheat flour', '1/2 kg bread']}
- renderItem={({item, index}) => (
- <TouchableOpacity
- style={{
- flexDirection: 'row',
- }}>
- <Text
- style={{
- color: 'white',
- ...getElevation(5),
- paddingVertical: pv - 5,
- paddingHorizontal: ph - 5,
- backgroundColor: colors.accent,
- marginVertical: 5,
- borderRadius: br,
- marginHorizontal: 10,
- fontFamily: WEIGHT.regular,
- }}>
- {item}
- </Text>
- </TouchableOpacity>
- )}
- />
- </View>
- </View>
- </View>
- );
-};
diff --git a/apps/mobile/src/views/Lists/index.js b/apps/mobile/src/views/Lists/index.js
deleted file mode 100644
index 97da8766f..000000000
--- a/apps/mobile/src/views/Lists/index.js
+++ /dev/null
@@ -1,46 +0,0 @@
-import React from 'react';
-import {Dimensions, Platform, SafeAreaView, Text, View} from 'react-native';
-import Icon from 'react-native-vector-icons/Ionicons';
-import {SIZE, WEIGHT} from '../../common/common';
-import {ListItem} from '../../components/ListItem';
-import {useTracked} from '../../provider';
-
-const w = Dimensions.get('window').width;
-const h = Dimensions.get('window').height;
-
-export const Lists = ({navigation}) => {
- const [state, dispatch] = useTracked();
- const {colors} = state;
-
- return (
- <SafeAreaView>
- <View
- style={{
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- paddingHorizontal: '5%',
- marginTop: Platform.OS == 'ios' ? h * 0.02 : h * 0.04,
- marginBottom: h * 0.04,
- }}>
- <Text
- style={{
- fontSize: SIZE.xl,
- color: colors.pri,
- fontFamily: WEIGHT.bold,
- }}>
- Lists
- </Text>
- <Icon name="md-more" color={colors.icon} size={SIZE.xl} />
- </View>
-
- <ListItem />
- </SafeAreaView>
- );
-};
-
-Lists.navigationOptions = {
- header: null,
-};
-
-export default Lists;
diff --git a/apps/mobile/src/views/ListsEditor/index.js b/apps/mobile/src/views/ListsEditor/index.js
deleted file mode 100644
index df3894695..000000000
--- a/apps/mobile/src/views/ListsEditor/index.js
+++ /dev/null
@@ -1,296 +0,0 @@
-import React, {createRef, useCallback, useState} from 'react';
-import {
- Dimensions,
- FlatList,
- SafeAreaView,
- Text,
- TextInput,
- TouchableOpacity,
- View,
-} from 'react-native';
-import Icon from 'react-native-vector-icons/Ionicons';
-import {COLOR_SCHEME, opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
-
-const w = Dimensions.get('window').width;
-const h = Dimensions.get('window').height;
-
-const saveText = (type, title, content) => {
- let data = {
- type,
- title,
- headline: content.slice(0, 60),
- timestamp: Date.now(),
- };
-};
-
-export function useForceUpdate() {
- const [, setTick] = useState(0);
- const update = useCallback(() => {
- setTick(tick => tick + 1);
- }, []);
- return update;
-}
-
-const ListsEditor = ({navigation}) => {
- const [colors, setColors] = useState(COLOR_SCHEME);
- const [listData, setListData] = useState(['']);
- const [deleteItemsList, setDeleteItemsList] = useState([]);
- const [deleteMode, setDeleteMode] = useState(false);
-
- const forceUpdate = useForceUpdate();
- const _textRender = createRef();
- let prevItem = null;
- let prevIndex = null;
- let currentSelectedItem = null;
-
- return (
- <SafeAreaView>
- <View
- style={{
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- paddingHorizontal: '5%',
- marginTop: Platform.OS == 'ios' ? h * 0.01 : h * 0.04,
- marginBottom: h * 0.04,
- }}>
- <TextInput
- style={{
- fontSize: SIZE.xl,
- color: colors.pri,
- fontFamily: WEIGHT.bold,
- paddingVertical: 0,
- paddingHorizontal: 0,
- maxWidth: '90%',
- width: '90%',
- }}
- placeholder="Untitled List"
- placeholderTextColor={colors.icon}
- />
- <Icon name="md-more" color={colors.icon} size={SIZE.xl} />
- </View>
-
- <TextInput
- ref={_textRender}
- style={{
- width: '90%',
- maxWidth: '90%',
- textAlignVertical: 'top',
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.semibold,
- marginHorizontal: '5%',
- paddingVertical: pv - 5,
- borderRadius: 5,
- paddingHorizontal: ph - 5,
- backgroundColor: colors.navbg,
- marginBottom: 10,
- }}
- numberOfLines={3}
- maxLength={80}
- multiline={true}
- placeholder="Write a short note about the list."
- placeholderTextColor={colors.icon}
- onChangeText={value => {
- _text = value;
- }}
- />
-
- <FlatList
- data={listData}
- renderItem={({item, index}) => (
- <ListItem
- item={item}
- index={index}
- deleteItemsList={deleteItemsList}
- deleteMode={deleteMode}
- addToDeleteList={index => {
- let items = deleteItemsList;
-
- if (items.includes(index)) {
- let i = items.indexOf(index);
- items.splice(i, 1);
- setDeleteItemsList(items);
- } else {
- items[items.length] = index;
-
- setDeleteItemsList(items);
- }
- items = null;
- forceUpdate();
- }}
- onSubmit={(text, index, willFocus = true) => {
- let oldData = listData;
- oldData[index] = text;
-
- if (
- oldData.length === index + 1 &&
- prevIndex !== null &&
- prevItem !== null
- ) {
- oldData.push('');
- }
-
- setListData(oldData);
- forceUpdate();
- currentSelectedItem = null;
-
- if (!willFocus) return;
- if (!refs[index + 1]) {
- setTimeout(() => {
- refs[index + 1].focus();
- }, 400);
- } else {
- refs[index + 1].focus();
- }
- }}
- onChange={(text, index) => {
- prevIndex = index;
- prevItem = text;
- }}
- onFocus={index => {
- currentSelectedItem = index;
- if (currentSelectedItem) {
- let oldData = listData;
- oldData[prevIndex] = prevItem;
- if (oldData.length === prevIndex + 1) {
- oldData.push('');
- }
- prevIndex = null;
- prevItem = null;
- setListData(oldData);
- forceUpdate();
- }
- }}
- />
- )}
- />
- </SafeAreaView>
- );
-};
-
-ListsEditor.navigationOptions = {
- header: null,
-};
-
-export default ListsEditor;
-
-const refs = [];
-
-const ListItem = props => {
- const [colors, setColors] = useState(COLOR_SCHEME);
- const inputRef = ref => (refs[props.index] = ref);
-
- const [showSubmit, setShowSubmit] = useState(false);
- let text = props.item;
-
- return (
- <View
- style={{
- flexDirection: 'row',
- width: '90%',
- maxWidth: '90%',
- marginHorizontal: '5%',
- marginVertical: 5,
- }}>
- <Text
- allowFontScaling={true}
- style={{
- paddingVertical: 5,
- height: 40,
- width: w * 0.9 * 0.1,
- textAlign: 'center',
- textAlignVertical: 'center',
- color: 'white',
- backgroundColor: colors.accent,
- borderRadius: 5,
- marginRight: 5,
- fontFamily: WEIGHT.regular,
- fontSize: SIZE.sm,
- }}>
- {props.index + 1}
- </Text>
- <TextInput
- ref={inputRef}
- editable={props.deleteMode ? false : true}
- placeholder={'List item - tap to edit'}
- style={{
- paddingVertical: 5,
- paddingHorizontal: ph,
- maxWidth: w * 0.9 * 0.8 - 10,
- backgroundColor: colors.navbg,
- borderRadius: 5,
- }}
- multiline={true}
- onFocus={() => props.onFocus(props.index)}
- onBlur={() => {
- setShowSubmit(false);
- props.onSubmit(text, props.index, false);
- }}
- onChangeText={value => {
- setShowSubmit(true);
- props.onChange(value, props.index);
-
- text = value;
- }}
- blurOnSubmit={true}
- onKeyPress={e => {
- if (e.nativeEvent.key === 'Enter') {
- e.preventDefault();
- props.onSubmit(text, props.index);
- }
- }}
- />
- {showSubmit && !props.deleteMode ? (
- <TouchableOpacity
- activeOpacity={opacity}
- onPress={() => props.onSubmit(text, props.index)}
- style={{
- paddingVertical: 5,
- height: 40,
- minWidth: w * 0.9 * 0.1,
- justifyContent: 'center',
- alignItems: 'center',
- color: 'white',
- backgroundColor: colors.navbg,
- borderRadius: 5,
- marginLeft: 5,
- }}>
- <Icon name="ios-checkmark" color={colors.accent} size={SIZE.md} />
- </TouchableOpacity>
- ) : (
- undefined
- )}
- {props.deleteMode ? (
- <TouchableOpacity
- activeOpacity={opacity}
- onPress={() => props.addToDeleteList(props.index)}
- style={{
- paddingVertical: 5,
- height: 40,
- minWidth: w * 0.9 * 0.1,
- justifyContent: 'center',
- alignItems: 'center',
- color: 'white',
- backgroundColor: props.deleteItemsList.includes(props.index)
- ? colors.accent
- : colors.navbg,
- borderRadius: 5,
- borderColor: props.deleteItemsList.includes(props.index)
- ? colors.accent
- : 'transparent',
- borderWidth: 1,
-
- marginLeft: 5,
- }}>
- {props.deleteItemsList.includes(props.index) ? (
- <Icon name="ios-checkmark" color="white" size={SIZE.xl} />
- ) : (
- undefined
- )}
- </TouchableOpacity>
- ) : (
- undefined
- )}
- </View>
- );
-};
diff --git a/apps/mobile/src/views/ReminderEditor/index.js b/apps/mobile/src/views/ReminderEditor/index.js
deleted file mode 100644
index 894ca3dc8..000000000
--- a/apps/mobile/src/views/ReminderEditor/index.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- *
-
-
-import React, {createRef, useCallback, useState} from 'react';
-import {Dimensions, SafeAreaView, Text, TextInput, View} from 'react-native';
-import Icon from 'react-native-vector-icons/Ionicons';
-import {COLOR_SCHEME, ph, pv, SIZE, WEIGHT} from '../../common/common';
-
-const w = Dimensions.get('window').width;
-const h = Dimensions.get('window').height;
-
-const saveText = (type, title, content) => {
- let data = {
- type,
- title,
- headline: content.slice(0, 60),
- timestamp: Date.now(),
- };
-};
-
-export function useForceUpdate() {
- const [, setTick] = useState(0);
- const update = useCallback(() => {
- setTick(tick => tick + 1);
- }, []);
- return update;
-}
-
-const ReminderEditor = ({navigation}) => {
- const [colors, setColors] = useState(COLOR_SCHEME);
-
- const _textRender = createRef();
-
- return (
- <SafeAreaView>
- <View
- style={{
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- paddingHorizontal: '5%',
- marginTop: Platform.OS == 'ios' ? h * 0.01 : h * 0.04,
- marginBottom: h * 0.04,
- }}>
- <Text
- style={{
- fontSize: SIZE.xl,
- color: colors.pri,
- fontFamily: WEIGHT.bold,
- paddingVertical: 0,
- paddingHorizontal: 0,
- maxWidth: '90%',
- width: '90%',
- }}>
- Set a Reminder
- </Text>
- <Icon name="md-more" color={colors.icon} size={SIZE.xl} />
- </View>
-
- <Text
- style={{
- width: '90%',
- alignSelf: 'center',
- fontFamily: WEIGHT.semibold,
- color: colors.pri,
- fontSize: SIZE.sm,
- marginBottom: 10,
- }}>
- What do you want to be reminded about?
- </Text>
-
- <TextInput
- ref={_textRender}
- style={{
- width: '90%',
- maxWidth: '90%',
- textAlignVertical: 'top',
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- marginHorizontal: '5%',
- paddingVertical: pv - 5,
- borderRadius: 5,
- paddingHorizontal: ph - 5,
- backgroundColor: colors.navbg,
- marginBottom: 15,
- }}
- maxLength={80}
- placeholder="eg. Sara's Birthday"
- placeholderTextColor={colors.icon}
- onChangeText={value => {
- _text = value;
- }}
- />
-
- <TextInput
- ref={_textRender}
- style={{
- width: '90%',
- maxWidth: '90%',
- textAlignVertical: 'top',
- fontSize: SIZE.sm,
- fontFamily: WEIGHT.regular,
- marginHorizontal: '5%',
- paddingVertical: pv - 5,
- borderRadius: 5,
- paddingHorizontal: ph - 5,
- backgroundColor: colors.navbg,
- marginBottom: 10,
- }}
- numberOfLines={3}
- maxLength={80}
- multiline={true}
- placeholder="You can add a short note here"
- placeholderTextColor={colors.icon}
- onChangeText={value => {
- _text = value;
- }}
- />
- </SafeAreaView>
- );
-};
-
-ReminderEditor.navigationOptions = {
- header: null,
-};
-
-export default ReminderEditor;
- */
diff --git a/apps/mobile/src/views/Reminders/index.js b/apps/mobile/src/views/Reminders/index.js
deleted file mode 100644
index 73ec092bd..000000000
--- a/apps/mobile/src/views/Reminders/index.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- *
-
-import React, {useState} from 'react';
-import {Dimensions, Platform, SafeAreaView, Text, View} from 'react-native';
-import Icon from 'react-native-vector-icons/Ionicons';
-import {COLOR_SCHEME, SIZE, WEIGHT} from '../../common/common';
-import {Reminder} from '../../components/Reminder';
-
-const w = Dimensions.get('window').width;
-const h = Dimensions.get('window').height;
-
-export const Reminders = ({navigation}) => {
- const [colors, setColors] = useState(COLOR_SCHEME);
-
- return (
- <SafeAreaView>
- <View
- style={{
- flexDirection: 'row',
- justifyContent: 'space-between',
- alignItems: 'center',
- paddingHorizontal: '5%',
- marginTop: Platform.OS == 'ios' ? h * 0.02 : h * 0.04,
- marginBottom: h * 0.04,
- }}>
- <Text
- style={{
- fontSize: SIZE.xl,
- color: colors.pri,
- fontFamily: WEIGHT.bold,
- }}>
- Reminders
- </Text>
- <Icon name="md-more" color={colors.icon} size={SIZE.xl} />
- </View>
-
- <Reminder invert={true} />
- </SafeAreaView>
- );
-};
-
-Reminders.navigationOptions = {
- header: null,
-};
-
-export default Reminders;
- */