mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
feat: add notebook adding dialog
This commit is contained in:
@@ -35,6 +35,12 @@ export const COLOR_SCHEME = {
|
|||||||
accent: '#0560FF',
|
accent: '#0560FF',
|
||||||
normal: 'black',
|
normal: 'black',
|
||||||
icon: 'gray',
|
icon: 'gray',
|
||||||
|
errorBg: '#FFD2D2',
|
||||||
|
errorText: '#D8000C',
|
||||||
|
successBg: '#DFF2BF',
|
||||||
|
successText: '#4F8A10',
|
||||||
|
warningBg: '#FEEFB3',
|
||||||
|
warningText: '#9F6000',
|
||||||
};
|
};
|
||||||
|
|
||||||
//FONT FAMILY
|
//FONT FAMILY
|
||||||
|
|||||||
304
apps/mobile/src/components/AddNotebookDialog/index.js
Normal file
304
apps/mobile/src/components/AddNotebookDialog/index.js
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {
|
||||||
|
ScrollView,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
Dimensions,
|
||||||
|
Image,
|
||||||
|
SafeAreaView,
|
||||||
|
Platform,
|
||||||
|
Modal,
|
||||||
|
} from 'react-native';
|
||||||
|
import NavigationService from '../../services/NavigationService';
|
||||||
|
import {
|
||||||
|
COLOR_SCHEME,
|
||||||
|
SIZE,
|
||||||
|
br,
|
||||||
|
ph,
|
||||||
|
pv,
|
||||||
|
opacity,
|
||||||
|
FONT,
|
||||||
|
WEIGHT,
|
||||||
|
} from '../../common/common';
|
||||||
|
import Icon from 'react-native-vector-icons/Feather';
|
||||||
|
|
||||||
|
import {getElevation, h, w, timeSince} from '../../utils/utils';
|
||||||
|
import {FlatList, TextInput} from 'react-native-gesture-handler';
|
||||||
|
import {useForceUpdate} from '../../views/ListsEditor';
|
||||||
|
|
||||||
|
const refs = [];
|
||||||
|
|
||||||
|
export const AddNotebookDialog = ({visible}) => {
|
||||||
|
const [colors, setColors] = useState(COLOR_SCHEME);
|
||||||
|
const [topicsToAdd, setTopicsToAdd] = useState(['']);
|
||||||
|
const forceUpdate = useForceUpdate();
|
||||||
|
let prevItem = null;
|
||||||
|
let prevIndex = null;
|
||||||
|
let currentSelectedItem = null;
|
||||||
|
|
||||||
|
const onSubmit = (text, index, willFocus = true) => {
|
||||||
|
let oldData = topicsToAdd;
|
||||||
|
oldData[index] = text;
|
||||||
|
|
||||||
|
if (
|
||||||
|
oldData.length === index + 1 &&
|
||||||
|
prevIndex !== null &&
|
||||||
|
prevItem !== null
|
||||||
|
) {
|
||||||
|
oldData.push('');
|
||||||
|
}
|
||||||
|
|
||||||
|
setTopicsToAdd(oldData);
|
||||||
|
forceUpdate();
|
||||||
|
currentSelectedItem = null;
|
||||||
|
|
||||||
|
if (!willFocus) return;
|
||||||
|
if (!refs[index + 1]) {
|
||||||
|
setTimeout(() => {
|
||||||
|
refs[index + 1].focus();
|
||||||
|
}, 400);
|
||||||
|
} else {
|
||||||
|
refs[index + 1].focus();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onFocus = index => {
|
||||||
|
currentSelectedItem = index;
|
||||||
|
if (currentSelectedItem) {
|
||||||
|
let oldData = topicsToAdd;
|
||||||
|
oldData[prevIndex] = prevItem;
|
||||||
|
if (oldData.length === prevIndex + 1) {
|
||||||
|
oldData.push('');
|
||||||
|
}
|
||||||
|
prevIndex = null;
|
||||||
|
prevItem = null;
|
||||||
|
setTopicsToAdd(oldData);
|
||||||
|
console.log(oldData);
|
||||||
|
forceUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onChange = (text, index) => {
|
||||||
|
prevIndex = index;
|
||||||
|
prevItem = text;
|
||||||
|
};
|
||||||
|
const onDelete = index => {
|
||||||
|
let listData = topicsToAdd;
|
||||||
|
listData.splice(index, 1);
|
||||||
|
setTopicsToAdd(listData);
|
||||||
|
forceUpdate();
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaView>
|
||||||
|
<Modal visible={visible} transparent={true}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
backgroundColor: 'rgba(255,255,255,0.3)',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
width: '80%',
|
||||||
|
maxHeight: '80%',
|
||||||
|
elevation: 5,
|
||||||
|
borderRadius: 5,
|
||||||
|
backgroundColor: colors.bg,
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
paddingVertical: pv,
|
||||||
|
}}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}>
|
||||||
|
<Icon name="book-open" color={colors.accent} size={SIZE.lg} />
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color: colors.accent,
|
||||||
|
fontFamily: WEIGHT.medium,
|
||||||
|
marginLeft: 10,
|
||||||
|
fontSize: SIZE.lg,
|
||||||
|
marginTop: -5,
|
||||||
|
}}>
|
||||||
|
New Notebook
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={{
|
||||||
|
padding: pv - 5,
|
||||||
|
borderWidth: 1.5,
|
||||||
|
borderColor: '#f0f0f0',
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
borderRadius: 5,
|
||||||
|
fontSize: SIZE.sm,
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
marginTop: 20,
|
||||||
|
marginBottom: 10,
|
||||||
|
}}
|
||||||
|
placeholder="Enter title of notebook"
|
||||||
|
placeholderTextColor={colors.icon}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: SIZE.sm,
|
||||||
|
fontFamily: WEIGHT.semibold,
|
||||||
|
}}>
|
||||||
|
Topics
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<FlatList
|
||||||
|
data={topicsToAdd}
|
||||||
|
renderItem={({item, index}) => (
|
||||||
|
<TopicItem
|
||||||
|
item={item}
|
||||||
|
index={index}
|
||||||
|
colors={colors}
|
||||||
|
onSubmit={onSubmit}
|
||||||
|
onChange={onChange}
|
||||||
|
onFocus={onFocus}
|
||||||
|
onDelete={onDelete}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
justifyContent: 'space-around',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
marginTop: 20,
|
||||||
|
}}>
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={opacity}
|
||||||
|
style={{
|
||||||
|
paddingVertical: pv,
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
borderRadius: 5,
|
||||||
|
width: '45%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
borderColor: colors.accent,
|
||||||
|
backgroundColor: colors.accent,
|
||||||
|
borderWidth: 1,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.medium,
|
||||||
|
color: 'white',
|
||||||
|
fontSize: SIZE.sm,
|
||||||
|
}}>
|
||||||
|
Add
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={opacity}
|
||||||
|
style={{
|
||||||
|
paddingVertical: pv,
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
borderRadius: 5,
|
||||||
|
width: '45%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor: '#f0f0f0',
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.medium,
|
||||||
|
color: colors.icon,
|
||||||
|
fontSize: SIZE.sm,
|
||||||
|
}}>
|
||||||
|
Cancel
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Modal>
|
||||||
|
</SafeAreaView>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const TopicItem = ({
|
||||||
|
item,
|
||||||
|
index,
|
||||||
|
onFocus,
|
||||||
|
onSubmit,
|
||||||
|
onDelete,
|
||||||
|
onChange,
|
||||||
|
colors,
|
||||||
|
}) => {
|
||||||
|
const [focus, setFocus] = useState(true);
|
||||||
|
const topicRef = ref => (refs[index] = ref);
|
||||||
|
|
||||||
|
let text = item;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
borderRadius: 5,
|
||||||
|
borderWidth: 1.5,
|
||||||
|
borderColor: '#f0f0f0',
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
marginTop: 10,
|
||||||
|
}}>
|
||||||
|
<TextInput
|
||||||
|
ref={topicRef}
|
||||||
|
onFocus={() => {
|
||||||
|
onFocus(index);
|
||||||
|
|
||||||
|
setFocus(true);
|
||||||
|
}}
|
||||||
|
onBlur={() => {
|
||||||
|
onSubmit(text, index, false);
|
||||||
|
setFocus(false);
|
||||||
|
}}
|
||||||
|
onChangeText={value => {
|
||||||
|
onChange(value, index);
|
||||||
|
|
||||||
|
text = value;
|
||||||
|
}}
|
||||||
|
onSubmit={() => onSubmit(text, index, true)}
|
||||||
|
blurOnSubmit
|
||||||
|
style={{
|
||||||
|
padding: pv - 5,
|
||||||
|
paddingHorizontal: 0,
|
||||||
|
fontSize: SIZE.sm,
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
width: '90%',
|
||||||
|
maxWidth: '90%',
|
||||||
|
}}
|
||||||
|
placeholder="Add a topic"
|
||||||
|
placeholderTextColor={colors.icon}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{index == 0 && !focus ? (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() =>
|
||||||
|
!focus && index !== 0
|
||||||
|
? onDelete(index)
|
||||||
|
: onSubmit(text, index, true)
|
||||||
|
}
|
||||||
|
style={{
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}>
|
||||||
|
<Icon
|
||||||
|
name={!focus && index !== 0 ? 'minus' : 'plus'}
|
||||||
|
size={SIZE.lg}
|
||||||
|
color={colors.accent}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
) : null}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -51,7 +51,7 @@ let blockdata = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const RecentList = () => {
|
export const RecentList = ({update}) => {
|
||||||
const [colors, setColors] = useState(COLOR_SCHEME);
|
const [colors, setColors] = useState(COLOR_SCHEME);
|
||||||
const [notes, setNotes] = useState([]);
|
const [notes, setNotes] = useState([]);
|
||||||
const fetchNotes = async () => {
|
const fetchNotes = async () => {
|
||||||
@@ -63,7 +63,7 @@ export const RecentList = () => {
|
|||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchNotes();
|
fetchNotes();
|
||||||
}, []);
|
}, [update]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import ForgotPassword from '../views/ForgotPassword';
|
|||||||
import Settings from '../views/Settings';
|
import Settings from '../views/Settings';
|
||||||
import Trash from '../views/Trash';
|
import Trash from '../views/Trash';
|
||||||
import Notes from '../views/Notes';
|
import Notes from '../views/Notes';
|
||||||
|
import Tags from '../views/Tags';
|
||||||
|
|
||||||
const TopLevelNavigator = createStackNavigator(
|
const TopLevelNavigator = createStackNavigator(
|
||||||
{
|
{
|
||||||
@@ -59,6 +60,9 @@ const TopLevelNavigator = createStackNavigator(
|
|||||||
Notes: {
|
Notes: {
|
||||||
screen: Notes,
|
screen: Notes,
|
||||||
},
|
},
|
||||||
|
Tags: {
|
||||||
|
screen: Tags,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
initialRouteName: 'Home',
|
initialRouteName: 'Home',
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
Platform,
|
Platform,
|
||||||
|
Modal,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import NavigationService from '../../services/NavigationService';
|
import NavigationService from '../../services/NavigationService';
|
||||||
import {
|
import {
|
||||||
@@ -20,17 +21,22 @@ import {
|
|||||||
FONT,
|
FONT,
|
||||||
WEIGHT,
|
WEIGHT,
|
||||||
} from '../../common/common';
|
} from '../../common/common';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Icon from 'react-native-vector-icons/Feather';
|
||||||
import {Reminder} from '../../components/Reminder';
|
import {Reminder} from '../../components/Reminder';
|
||||||
import {ListItem} from '../../components/ListItem';
|
import {ListItem} from '../../components/ListItem';
|
||||||
import {getElevation, h, w} from '../../utils/utils';
|
import {getElevation, h, w, timeSince} from '../../utils/utils';
|
||||||
import {FlatList} from 'react-native-gesture-handler';
|
import {FlatList, TextInput} from 'react-native-gesture-handler';
|
||||||
|
import {useForceUpdate} from '../ListsEditor';
|
||||||
|
import {AddNotebookDialog} from '../../components/AddNotebookDialog';
|
||||||
|
|
||||||
|
const refs = [];
|
||||||
|
|
||||||
export const Folders = ({navigation}) => {
|
export const Folders = ({navigation}) => {
|
||||||
const [colors, setColors] = useState(COLOR_SCHEME);
|
const [colors, setColors] = useState(COLOR_SCHEME);
|
||||||
|
const [addNotebook, setAddNotebook] = useState(false);
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
|
<AddNotebookDialog visible={addNotebook} />
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -48,19 +54,13 @@ export const Folders = ({navigation}) => {
|
|||||||
}}>
|
}}>
|
||||||
Notebooks
|
Notebooks
|
||||||
</Text>
|
</Text>
|
||||||
<Icon name="md-more" color={colors.icon} size={SIZE.xxl} />
|
<Icon name="more-vertical" color={colors.icon} size={SIZE.xxl} />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<FlatList
|
<FlatList
|
||||||
numColumns={2}
|
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}}
|
}}
|
||||||
columnWrapperStyle={{
|
|
||||||
paddingHorizontal: '5%',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
width: '100%',
|
|
||||||
}}
|
|
||||||
data={[
|
data={[
|
||||||
{
|
{
|
||||||
name: 'Class Notes',
|
name: 'Class Notes',
|
||||||
@@ -75,38 +75,77 @@ export const Folders = ({navigation}) => {
|
|||||||
Qty: '3',
|
Qty: '3',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
renderItem={({item, index}) => (
|
ListHeaderComponent={
|
||||||
<View>
|
<TouchableOpacity
|
||||||
<View
|
activeOpacity={opacity}
|
||||||
|
onPress={() => {
|
||||||
|
setAddNotebook(true);
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
borderWidth: 1,
|
||||||
|
borderRadius: 5,
|
||||||
|
width: '90%',
|
||||||
|
marginHorizontal: '5%',
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
borderColor: '#f0f0f0',
|
||||||
|
paddingVertical: pv + 5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginBottom: 15,
|
||||||
|
backgroundColor: colors.accent,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
style={{
|
style={{
|
||||||
...getElevation(5),
|
fontSize: SIZE.md,
|
||||||
width: w * 0.7 * 0.4,
|
fontFamily: WEIGHT.bold,
|
||||||
height: w * 0.7 * 0.3,
|
color: 'white',
|
||||||
borderRadius: 5,
|
|
||||||
backgroundColor: colors.accent,
|
|
||||||
alignItems: 'flex-end',
|
|
||||||
justifyContent: 'flex-end',
|
|
||||||
padding: 5,
|
|
||||||
}}>
|
}}>
|
||||||
<Text
|
Create new notebook
|
||||||
style={{
|
</Text>
|
||||||
fontFamily: WEIGHT.regular,
|
<Icon name="plus" color="white" size={SIZE.lg} />
|
||||||
fontSize: SIZE.md,
|
</TouchableOpacity>
|
||||||
color: 'white',
|
}
|
||||||
opacity: 0.5,
|
renderItem={({item, index}) => (
|
||||||
}}>
|
<View
|
||||||
{item.Qty} Notes
|
style={{
|
||||||
</Text>
|
paddingHorizontal: ph,
|
||||||
</View>
|
marginHorizontal: '5%',
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomColor: '#f0f0f0',
|
||||||
|
paddingVertical: pv + 5,
|
||||||
|
}}>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
fontFamily: WEIGHT.bold,
|
fontFamily: WEIGHT.bold,
|
||||||
fontSize: SIZE.md,
|
fontSize: SIZE.md,
|
||||||
color: colors.pri,
|
color: colors.pri,
|
||||||
maxWidth: w * 0.7 * 0.4,
|
maxWidth: '100%',
|
||||||
}}>
|
}}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingTop: pv,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
fontSize: SIZE.xs,
|
||||||
|
color: colors.accent,
|
||||||
|
}}>
|
||||||
|
June 21
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
fontSize: SIZE.xs,
|
||||||
|
}}>
|
||||||
|
15 notes
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export const Home = ({navigation}) => {
|
|||||||
const [hidden, setHidden] = useState(false);
|
const [hidden, setHidden] = useState(false);
|
||||||
const [text, setText] = useState('');
|
const [text, setText] = useState('');
|
||||||
const [searchResults, setSearchResults] = useState([]);
|
const [searchResults, setSearchResults] = useState([]);
|
||||||
|
const [update, setUpdate] = useState(0);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -82,6 +83,7 @@ export const Home = ({navigation}) => {
|
|||||||
<NavigationEvents
|
<NavigationEvents
|
||||||
onWillFocus={() => {
|
onWillFocus={() => {
|
||||||
DeviceEventEmitter.emit('openSidebar');
|
DeviceEventEmitter.emit('openSidebar');
|
||||||
|
setUpdate(update + 1);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Header colors={colors} heading="Home" canGoBack={false} />
|
<Header colors={colors} heading="Home" canGoBack={false} />
|
||||||
@@ -110,6 +112,12 @@ export const Home = ({navigation}) => {
|
|||||||
menu={<RenderSideMenu colors={colors} close={() => setOpen(false)} />}
|
menu={<RenderSideMenu colors={colors} close={() => setOpen(false)} />}
|
||||||
openMenuOffset={w / 1.5}>
|
openMenuOffset={w / 1.5}>
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView style={styles.container}>
|
||||||
|
<NavigationEvents
|
||||||
|
onWillFocus={() => {
|
||||||
|
setUpdate(update + 1);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<Header
|
<Header
|
||||||
colors={colors}
|
colors={colors}
|
||||||
heading="Home"
|
heading="Home"
|
||||||
@@ -129,7 +137,7 @@ export const Home = ({navigation}) => {
|
|||||||
{hidden ? (
|
{hidden ? (
|
||||||
<NotesList searchResults={searchResults} keyword={text} />
|
<NotesList searchResults={searchResults} keyword={text} />
|
||||||
) : (
|
) : (
|
||||||
<RecentList />
|
<RecentList update={update} />
|
||||||
)}
|
)}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
</SideMenu>
|
</SideMenu>
|
||||||
@@ -152,93 +160,9 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
|
height: '100%',
|
||||||
}}>
|
}}>
|
||||||
<View>
|
<View>
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
paddingHorizontal: '5%',
|
|
||||||
alignItems: 'center',
|
|
||||||
alignSelf: 'center',
|
|
||||||
marginBottom: 10,
|
|
||||||
marginTop: Platform.OS == 'ios' ? h * 0.01 : h * 0.05,
|
|
||||||
flexDirection: 'row',
|
|
||||||
}}>
|
|
||||||
<Image
|
|
||||||
style={{
|
|
||||||
width: 35,
|
|
||||||
height: 35,
|
|
||||||
borderRadius: 100,
|
|
||||||
marginRight: 10,
|
|
||||||
}}
|
|
||||||
source={require('../../assets/images/img.png')}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={() => {
|
|
||||||
close();
|
|
||||||
|
|
||||||
NavigationService.navigate('Login');
|
|
||||||
}}
|
|
||||||
activeOpacity={opacity}
|
|
||||||
style={{
|
|
||||||
paddingVertical: pv - 5,
|
|
||||||
paddingHorizontal: ph,
|
|
||||||
borderRadius: 5,
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
borderColor: colors.accent,
|
|
||||||
backgroundColor: colors.accent,
|
|
||||||
borderWidth: 1,
|
|
||||||
}}>
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
fontFamily: WEIGHT.medium,
|
|
||||||
color: 'white',
|
|
||||||
}}>
|
|
||||||
Login
|
|
||||||
</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
|
|
||||||
{/* <Text
|
|
||||||
style={{
|
|
||||||
fontFamily: WEIGHT.semibold,
|
|
||||||
color: colors.accent,
|
|
||||||
fontSize: SIZE.md,
|
|
||||||
marginTop: 10,
|
|
||||||
}}>
|
|
||||||
Hi, Ammar!
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
fontFamily: WEIGHT.regular,
|
|
||||||
color: colors.accent,
|
|
||||||
fontSize: SIZE.xs,
|
|
||||||
marginTop: 10,
|
|
||||||
}}>
|
|
||||||
80.45/100 MB
|
|
||||||
</Text> */}
|
|
||||||
|
|
||||||
{/* <View
|
|
||||||
style={{
|
|
||||||
borderRadius: 2.5,
|
|
||||||
backgroundColor: colors.accent,
|
|
||||||
marginTop: 10,
|
|
||||||
paddingHorizontal: 5,
|
|
||||||
paddingVertical: 2,
|
|
||||||
}}>
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
fontFamily: WEIGHT.bold,
|
|
||||||
fontSize: SIZE.xxs,
|
|
||||||
color: 'white',
|
|
||||||
}}>
|
|
||||||
Basic User
|
|
||||||
</Text>
|
|
||||||
</View> */}
|
|
||||||
</View>
|
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -247,6 +171,7 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
backgroundColor: colors.navbg,
|
backgroundColor: colors.navbg,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
|
marginTop: Platform.OS == 'ios' ? h * 0.01 : h * 0.03,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<FlatList
|
<FlatList
|
||||||
@@ -340,10 +265,12 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</View>
|
|
||||||
|
|
||||||
<View>
|
<TouchableOpacity
|
||||||
<View
|
onPress={() => {
|
||||||
|
close();
|
||||||
|
NavigationService.navigate('Tags');
|
||||||
|
}}
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
@@ -351,7 +278,7 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
justifyContent: 'flex-start',
|
justifyContent: 'flex-start',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
paddingHorizontal: ph,
|
paddingHorizontal: ph,
|
||||||
marginTop: 20,
|
marginTop: 15,
|
||||||
}}>
|
}}>
|
||||||
<Icon
|
<Icon
|
||||||
style={{
|
style={{
|
||||||
@@ -365,11 +292,10 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
style={{
|
style={{
|
||||||
fontFamily: WEIGHT.medium,
|
fontFamily: WEIGHT.medium,
|
||||||
fontSize: SIZE.sm - 1,
|
fontSize: SIZE.sm - 1,
|
||||||
marginTop: -5,
|
|
||||||
}}>
|
}}>
|
||||||
Tags
|
Tags
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
@@ -386,7 +312,7 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
paddingHorizontal: '5%',
|
paddingHorizontal: '5%',
|
||||||
marginBottom: 20,
|
marginBottom: 0,
|
||||||
}}>
|
}}>
|
||||||
{[
|
{[
|
||||||
'home',
|
'home',
|
||||||
@@ -422,33 +348,6 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
<View
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
alignSelf: 'center',
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'flex-start',
|
|
||||||
alignItems: 'center',
|
|
||||||
paddingHorizontal: ph,
|
|
||||||
marginTop: 20,
|
|
||||||
}}>
|
|
||||||
<Icon
|
|
||||||
style={{
|
|
||||||
width: 30,
|
|
||||||
}}
|
|
||||||
name="circle"
|
|
||||||
color={colors.icon}
|
|
||||||
size={SIZE.md}
|
|
||||||
/>
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
fontFamily: WEIGHT.medium,
|
|
||||||
fontSize: SIZE.sm - 1,
|
|
||||||
marginTop: -5,
|
|
||||||
}}>
|
|
||||||
Colors
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -464,7 +363,7 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
paddingHorizontal: '5%',
|
paddingHorizontal: '5%',
|
||||||
marginBottom: 40,
|
marginBottom: 15,
|
||||||
}}>
|
}}>
|
||||||
{['red', 'yellow', 'green', 'blue', 'purple', 'orange', 'gray'].map(
|
{['red', 'yellow', 'green', 'blue', 'purple', 'orange', 'gray'].map(
|
||||||
item => (
|
item => (
|
||||||
@@ -477,18 +376,19 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
}}>
|
}}>
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
width: 40,
|
width: 25,
|
||||||
height: 25,
|
height: 25,
|
||||||
backgroundColor: item,
|
backgroundColor: item,
|
||||||
borderRadius: 5,
|
borderRadius: 100,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
|
||||||
<View
|
{/* <View
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: '#F3A712',
|
backgroundColor: '#F3A712',
|
||||||
width: '90%',
|
width: '90%',
|
||||||
@@ -519,7 +419,83 @@ export const RenderSideMenu = ({colors, close}) => (
|
|||||||
}}>
|
}}>
|
||||||
<Icon name="star" color="#FCBA04" size={SIZE.lg} />
|
<Icon name="star" color="#FCBA04" size={SIZE.lg} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View> */}
|
||||||
|
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
paddingHorizontal: '5%',
|
||||||
|
alignItems: 'center',
|
||||||
|
alignSelf: 'center',
|
||||||
|
marginBottom: 20,
|
||||||
|
flexDirection: 'row',
|
||||||
|
}}>
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => {
|
||||||
|
close();
|
||||||
|
|
||||||
|
NavigationService.navigate('Login');
|
||||||
|
}}
|
||||||
|
activeOpacity={opacity}
|
||||||
|
style={{
|
||||||
|
paddingVertical: pv,
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
borderRadius: 5,
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
borderColor: colors.accent,
|
||||||
|
backgroundColor: colors.accent,
|
||||||
|
borderWidth: 1,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.medium,
|
||||||
|
color: 'white',
|
||||||
|
fontSize: SIZE.sm,
|
||||||
|
}}>
|
||||||
|
Login to Sync
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
{/* <Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.semibold,
|
||||||
|
color: colors.accent,
|
||||||
|
fontSize: SIZE.md,
|
||||||
|
marginTop: 10,
|
||||||
|
}}>
|
||||||
|
Hi, Ammar!
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
color: colors.accent,
|
||||||
|
fontSize: SIZE.xs,
|
||||||
|
marginTop: 10,
|
||||||
|
}}>
|
||||||
|
80.45/100 MB
|
||||||
|
</Text> */}
|
||||||
|
|
||||||
|
{/* <View
|
||||||
|
style={{
|
||||||
|
borderRadius: 2.5,
|
||||||
|
backgroundColor: colors.accent,
|
||||||
|
marginTop: 10,
|
||||||
|
paddingHorizontal: 5,
|
||||||
|
paddingVertical: 2,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.bold,
|
||||||
|
fontSize: SIZE.xxs,
|
||||||
|
color: 'white',
|
||||||
|
}}>
|
||||||
|
Basic User
|
||||||
|
</Text>
|
||||||
|
</View> */}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
|||||||
@@ -20,10 +20,11 @@ import {
|
|||||||
FONT,
|
FONT,
|
||||||
WEIGHT,
|
WEIGHT,
|
||||||
} from '../../common/common';
|
} from '../../common/common';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Icon from 'react-native-vector-icons/Feather';
|
||||||
import {Reminder} from '../../components/Reminder';
|
import {Reminder} from '../../components/Reminder';
|
||||||
import {ListItem} from '../../components/ListItem';
|
import {ListItem} from '../../components/ListItem';
|
||||||
import {Header} from '../../components/header';
|
import {Header} from '../../components/header';
|
||||||
|
import {FlatList} from 'react-native-gesture-handler';
|
||||||
|
|
||||||
const w = Dimensions.get('window').width;
|
const w = Dimensions.get('window').width;
|
||||||
const h = Dimensions.get('window').height;
|
const h = Dimensions.get('window').height;
|
||||||
@@ -34,6 +35,65 @@ export const Settings = ({navigation}) => {
|
|||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Header colors={colors} heading="Settings" canGoBack={false} />
|
<Header colors={colors} heading="Settings" canGoBack={false} />
|
||||||
|
|
||||||
|
<FlatList
|
||||||
|
data={['Sync']}
|
||||||
|
ListHeaderComponent={
|
||||||
|
<FlatList
|
||||||
|
data={['My Account']}
|
||||||
|
ListHeaderComponent={<FlatList />}
|
||||||
|
renderItem={({item, index}) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={opacity}
|
||||||
|
style={{
|
||||||
|
borderWidth: 1,
|
||||||
|
borderRadius: 5,
|
||||||
|
width: '90%',
|
||||||
|
marginHorizontal: '5%',
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
borderColor: '#f0f0f0',
|
||||||
|
paddingVertical: pv + 5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginBottom: 15,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: SIZE.md,
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
}}>
|
||||||
|
{item}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
renderItem={({item, index}) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={opacity}
|
||||||
|
style={{
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
width: '90%',
|
||||||
|
marginHorizontal: '5%',
|
||||||
|
borderBottomColor: '#f0f0f0',
|
||||||
|
paddingVertical: pv + 5,
|
||||||
|
flexDirection: 'row',
|
||||||
|
paddingHorizontal: ph,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: SIZE.md,
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
}}>
|
||||||
|
{item}
|
||||||
|
</Text>
|
||||||
|
<Icon size={SIZE.lg} color={colors.icon} name="toggle-left" />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
162
apps/mobile/src/views/Tags/index.js
Normal file
162
apps/mobile/src/views/Tags/index.js
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
import React, {useEffect, useState} from 'react';
|
||||||
|
import {
|
||||||
|
ScrollView,
|
||||||
|
View,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
Dimensions,
|
||||||
|
Image,
|
||||||
|
SafeAreaView,
|
||||||
|
Platform,
|
||||||
|
FlatList,
|
||||||
|
} from 'react-native';
|
||||||
|
import NavigationService from '../../services/NavigationService';
|
||||||
|
import {
|
||||||
|
COLOR_SCHEME,
|
||||||
|
SIZE,
|
||||||
|
br,
|
||||||
|
ph,
|
||||||
|
pv,
|
||||||
|
opacity,
|
||||||
|
FONT,
|
||||||
|
WEIGHT,
|
||||||
|
} from '../../common/common';
|
||||||
|
import Icon from 'react-native-vector-icons/Ionicons';
|
||||||
|
import {Reminder} from '../../components/Reminder';
|
||||||
|
import {ListItem} from '../../components/ListItem';
|
||||||
|
import {Header} from '../../components/header';
|
||||||
|
import NoteItem from '../../components/NoteItem';
|
||||||
|
|
||||||
|
const w = Dimensions.get('window').width;
|
||||||
|
const h = Dimensions.get('window').height;
|
||||||
|
|
||||||
|
export const Tags = ({navigation}) => {
|
||||||
|
const [colors, setColors] = useState(COLOR_SCHEME);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaView
|
||||||
|
style={{
|
||||||
|
height: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
}}>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
height: '100%',
|
||||||
|
marginTop: h * 0.1,
|
||||||
|
width: '100%',
|
||||||
|
justifyContent: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}>
|
||||||
|
<ScrollView
|
||||||
|
contentContainerStyle={{
|
||||||
|
width: '90%',
|
||||||
|
|
||||||
|
alignSelf: 'center',
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
}}>
|
||||||
|
{[
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
'#home',
|
||||||
|
'#school',
|
||||||
|
'#water',
|
||||||
|
'#love',
|
||||||
|
'#hope',
|
||||||
|
'#music',
|
||||||
|
'#notesforbook',
|
||||||
|
'#hate',
|
||||||
|
'#worldofwonders',
|
||||||
|
].map(item => (
|
||||||
|
<TouchableOpacity
|
||||||
|
onPress={() => {
|
||||||
|
NavigationService.navigate('Notes', {
|
||||||
|
heading: item,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'flex-start',
|
||||||
|
alignItems: 'center',
|
||||||
|
margin: 5,
|
||||||
|
backgroundColor: colors.accent,
|
||||||
|
paddingVertical: pv - 5,
|
||||||
|
paddingHorizontal: ph + 10,
|
||||||
|
borderRadius: 30,
|
||||||
|
}}>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
fontSize: SIZE.md,
|
||||||
|
color: 'white',
|
||||||
|
}}>
|
||||||
|
{item}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
))}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
</SafeAreaView>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Tags.navigationOptions = {
|
||||||
|
header: null,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Tags;
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
Platform,
|
Platform,
|
||||||
|
FlatList,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import NavigationService from '../../services/NavigationService';
|
import NavigationService from '../../services/NavigationService';
|
||||||
import {
|
import {
|
||||||
@@ -24,6 +25,7 @@ import Icon from 'react-native-vector-icons/Ionicons';
|
|||||||
import {Reminder} from '../../components/Reminder';
|
import {Reminder} from '../../components/Reminder';
|
||||||
import {ListItem} from '../../components/ListItem';
|
import {ListItem} from '../../components/ListItem';
|
||||||
import {Header} from '../../components/header';
|
import {Header} from '../../components/header';
|
||||||
|
import NoteItem from '../../components/NoteItem';
|
||||||
|
|
||||||
const w = Dimensions.get('window').width;
|
const w = Dimensions.get('window').width;
|
||||||
const h = Dimensions.get('window').height;
|
const h = Dimensions.get('window').height;
|
||||||
@@ -34,6 +36,25 @@ export const Trash = ({navigation}) => {
|
|||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Header colors={colors} heading="Trash" canGoBack={false} />
|
<Header colors={colors} heading="Trash" canGoBack={false} />
|
||||||
|
<FlatList
|
||||||
|
numColumns={2}
|
||||||
|
columnWrapperStyle={{
|
||||||
|
width: '45%',
|
||||||
|
}}
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
title: 'my note',
|
||||||
|
headline: 'my simple not that i just deleted. please restore.',
|
||||||
|
dateCreated: Date.now(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'my note',
|
||||||
|
headline: 'my simple not that i just deleted. please restore.',
|
||||||
|
dateCreated: Date.now(),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
renderItem={({item, index}) => <NoteItem item={item} />}
|
||||||
|
/>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user