Skip to content

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

add new placeholders

ammarahm-ed274d5c9154e6
diff --git a/apps/mobile/src/views/Favorites/index.js b/apps/mobile/src/views/Favorites/index.js
index 4f12c770b..4dcf745a6 100644
--- a/apps/mobile/src/views/Favorites/index.js
+++ b/apps/mobile/src/views/Favorites/index.js
@@ -69,6 +69,11 @@ export const Favorites = ({route, navigation}) => {
refreshCallback={() => {
dispatch({type: Actions.FAVORITES});
}}
+ placeholderData={{
+ heading:"Your Favorites",
+ paragraph:"You have not added any notes to favorites yet.",
+ button:null,
+ }}
focused={() => navigation.isFocused()}
RenderItem={NoteItemWrapper}
placeholder={<Placeholder type="favorites" />}
diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js
index c23fe8567..0a7937c32 100644
--- a/apps/mobile/src/views/Folders/index.js
+++ b/apps/mobile/src/views/Folders/index.js
@@ -30,7 +30,6 @@ export const Folders = ({route, navigation}) => {
screen: 'notebooks',
});
updateSearch();
-
}, [notebooks]);
const updateSearch = () => {
@@ -46,8 +45,7 @@ export const Folders = ({route, navigation}) => {
color: null,
});
}
- }
-
+ };
useEffect(() => {
navigation.addListener('focus', onFocus);
@@ -75,12 +73,21 @@ export const Folders = ({route, navigation}) => {
type="notebooks"
focused={() => navigation.isFocused()}
RenderItem={NotebookItemWrapper}
+ placeholderData={{
+ heading:"Your Notebooks",
+ paragraph:"You have not added any notebooks yet.",
+ button:"Add a Notebook",
+ action:_onPressBottomButton
+ }}
placeholder={<Placeholder type="notebooks" />}
/>
- <ContainerBottomButton
- title="Create a new notebook"
- onPress={_onPressBottomButton}
- />
+
+ {!notebooks || notebooks.length === 0 ? null : (
+ <ContainerBottomButton
+ title="Create a new notebook"
+ onPress={_onPressBottomButton}
+ />
+ )}
</>
);
};
diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.js
index b7a2d75e4..7e11a2823 100755
--- a/apps/mobile/src/views/Home/index.js
+++ b/apps/mobile/src/views/Home/index.js
@@ -23,7 +23,7 @@ export const Home = ({navigation}) => {
dispatch({
type: Actions.HEADER_TEXT_STATE,
state: {
- heading: 'Home',
+ heading: 'Notes',
},
});
dispatch({
@@ -95,12 +95,20 @@ export const Home = ({navigation}) => {
placeholder={<Placeholder type="notes" />}
placeholderText={`Notes you write appear here`}
jumpToDialog={true}
+ placeholderData={{
+ heading: 'Your Notes',
+ paragraph: 'You have not added any notes yet.',
+ button: 'Add your First Note',
+ action: _onPressBottomButton,
+ }}
/>
- <ContainerBottomButton
- title="Create a new note"
- onPress={_onPressBottomButton}
- />
+ {!notes || notes.length === 0 ? null : (
+ <ContainerBottomButton
+ title="Create a new note"
+ onPress={_onPressBottomButton}
+ />
+ )}
</>
);
};
diff --git a/apps/mobile/src/views/Notebook/index.js b/apps/mobile/src/views/Notebook/index.js
index 48215f1a6..19b9419a7 100644
--- a/apps/mobile/src/views/Notebook/index.js
+++ b/apps/mobile/src/views/Notebook/index.js
@@ -124,7 +124,7 @@ const RenderItem = ({item, index}) => {
return (
<SelectionWrapper
onPress={() => {
- NavigationService.navigate('Notes', {
+ NavigationService.navigate('NotesPage', {
...item,
});
}}
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index 561ae50c7..360139943 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -25,6 +25,7 @@ import {
eOpenRecoveryKeyDialog,
eOpenRestoreDialog,
eResetApp,
+ eScrollEvent,
eUpdateSearchState,
} from '../../utils/Events';
import NavigationService from '../../services/Navigation';
@@ -45,6 +46,7 @@ import {DDS} from '../../services/DeviceDetection';
import {MMKV} from '../../utils/mmkv';
import Backup from '../../services/Backup';
import Menu, {MenuItem} from 'react-native-material-menu';
+import {ListHeaderComponent} from '../../components/SimpleList/ListHeaderComponent';
let menuRef = createRef();
export const Settings = ({navigation}) => {
@@ -52,7 +54,6 @@ export const Settings = ({navigation}) => {
const {colors, user, settings} = state;
function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) {
let newColors = setColorScheme(colors, accent);
- StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content');
dispatch({type: Actions.THEME, colors: newColors});
}
@@ -85,11 +86,8 @@ export const Settings = ({navigation}) => {
type: '',
color: null,
});
-
}, []);
-
-
useEffect(() => {
navigation.addListener('focus', onFocus);
return () => {
@@ -109,14 +107,12 @@ export const Settings = ({navigation}) => {
const SectionHeader = ({title}) => (
<Text
style={{
- fontSize: SIZE.xs,
+ fontSize: SIZE.sm,
fontFamily: WEIGHT.bold,
textAlignVertical: 'center',
color: colors.accent,
paddingHorizontal: 12,
- borderBottomColor: colors.nav,
- borderBottomWidth: 0.5,
- paddingBottom: 3,
+ height: 35,
}}>
{title}
</Text>
@@ -179,7 +175,7 @@ export const Settings = ({navigation}) => {
}}>
<Text
style={{
- fontSize: SIZE.sm,
+ fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
@@ -189,7 +185,7 @@ export const Settings = ({navigation}) => {
<Text
style={{
- fontSize: SIZE.xs,
+ fontSize: SIZE.sm,
color: colors.icon,
}}>
{tagline}
@@ -207,15 +203,15 @@ export const Settings = ({navigation}) => {
height: '100%',
backgroundColor: colors.bg,
}}>
- <View
- style={{
- marginTop: Platform.OS === 'ios' ? 125 - 60 : 125 - 60,
- }}
- />
<ScrollView
+ onScroll={(e) =>
+ eSendEvent(eScrollEvent, e.nativeEvent.contentOffset.y)
+ }
style={{
paddingHorizontal: 0,
}}>
+ <ListHeaderComponent type="settings" messageCard={false} />
+
{user ? (
<>
<View
@@ -349,25 +345,22 @@ export const Settings = ({navigation}) => {
<>
<View
style={{
- paddingHorizontal: 12,
+ paddingHorizontal: 0,
}}>
<PressableButton
- color={colors.shade}
- selectedColor={colors.accent}
+ color="transparent"
+ selectedColor={colors.nav}
alpha={!colors.night ? -0.02 : 0.1}
- opacity={0.12}
onPress={() => {
eSendEvent(eOpenLoginDialog);
}}
activeOpacity={opacity / 2}
customStyle={{
paddingVertical: pv + 5,
- marginBottom: pv + 5,
width: '100%',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
- borderRadius: 5,
paddingHorizontal: 6,
}}>
<View
@@ -426,7 +419,7 @@ export const Settings = ({navigation}) => {
<Text
style={{
- fontSize: SIZE.sm,
+ fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
@@ -436,7 +429,7 @@ export const Settings = ({navigation}) => {
Accent Color{'\n'}
<Text
style={{
- fontSize: SIZE.xs,
+ fontSize: SIZE.sm,
color: colors.icon,
}}>
Choose a color to use as accent color
@@ -508,7 +501,7 @@ export const Settings = ({navigation}) => {
flexDirection: 'row',
flexWrap: 'wrap',
}}>
- {['#46f0f0', '#f032e6', '#bcf60c', '#fabebe'].map((item,index) => (
+ {['#46f0f0', '#f032e6', '#bcf60c', '#fabebe'].map((item, index) => (
<PressableButton
key={item}
color={
@@ -532,8 +525,11 @@ export const Settings = ({navigation}) => {
justifyContent: 'center',
alignItems: 'center',
marginTop: 5,
- marginRight: ((dWidth) - ((dWidth / 7.5) * 6))/12 ,
- marginLeft: index === 0 ? 0.5 : ((dWidth - 12) - ((dWidth / 7.5) * 6))/12.1 ,
+ marginRight: (dWidth - (dWidth / 7.5) * 6) / 12,
+ marginLeft:
+ index === 0
+ ? 0.5
+ : (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,
@@ -626,7 +622,7 @@ export const Settings = ({navigation}) => {
<Icon color={colors.icon} name="menu-down" size={SIZE.md} />
</TouchableOpacity>
}>
- {MenuItemsList.slice(0,MenuItemsList.length - 1).map((item) => (
+ {MenuItemsList.slice(0, MenuItemsList.length - 1).map((item) => (
<MenuItem
onPress={async () => {
await setSetting(settings, 'homepage', item.name);
@@ -664,7 +660,7 @@ export const Settings = ({navigation}) => {
}}>
<Text
style={{
- fontSize: SIZE.sm,
+ fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
@@ -672,7 +668,7 @@ export const Settings = ({navigation}) => {
Font Scaling{'\n'}
<Text
style={{
- fontSize: SIZE.xs,
+ fontSize: SIZE.sm,
color: colors.icon,
}}>
Scale the size of text in the app.
@@ -726,7 +722,7 @@ export const Settings = ({navigation}) => {
style={{
color:
settings.fontScale === item.value ? 'white' : colors.icon,
- fontSize: SIZE.xs,
+ fontSize: SIZE.sm,
}}>
{item.title}
</Text>
@@ -784,7 +780,7 @@ export const Settings = ({navigation}) => {
}}>
<Text
style={{
- fontSize: SIZE.sm,
+ fontSize: SIZE.md,
fontFamily: WEIGHT.regular,
textAlignVertical: 'center',
color: colors.pri,
@@ -792,7 +788,7 @@ export const Settings = ({navigation}) => {
Auto Backup{'\n'}
<Text
style={{
- fontSize: SIZE.xs,
+ fontSize: SIZE.sm,
color: colors.icon,
}}>
Backup your data automatically.
@@ -914,7 +910,11 @@ export const Settings = ({navigation}) => {
onPress={item.func}
/>
))}
- <Seperator />
+ <View
+ style={{
+ height: 400,
+ }}
+ />
</ScrollView>
</Animatable.View>
);
diff --git a/apps/mobile/src/views/Tags/index.js b/apps/mobile/src/views/Tags/index.js
index 5dda6573b..d23500b90 100644
--- a/apps/mobile/src/views/Tags/index.js
+++ b/apps/mobile/src/views/Tags/index.js
@@ -70,6 +70,11 @@ export const Tags = ({route, navigation}) => {
type="tags"
focused={() => navigation.isFocused()}
RenderItem={RenderItem}
+ placeholderData={{
+ heading:"Your Favorites",
+ paragraph:"You have not added any notes to favorites yet.",
+ button:null,
+ }}
placeholder={<Placeholder type="tags" />}
placeholderText="Tags added to notes appear here"
/>
@@ -84,7 +89,7 @@ const RenderItem = ({item, index}) => {
return (
<PressableButton
onPress={() => {
- NavigationService.navigate('Notes', {
+ NavigationService.navigate('NotesPage', {
type: 'tag',
title: item.title,
tag: item,
diff --git a/apps/mobile/src/views/Trash/index.js b/apps/mobile/src/views/Trash/index.js
index 1b14cee56..46d9da497 100644
--- a/apps/mobile/src/views/Trash/index.js
+++ b/apps/mobile/src/views/Trash/index.js
@@ -74,14 +74,21 @@ export const Trash = ({route, navigation}) => {
type="trash"
focused={() => navigation.isFocused()}
RenderItem={RenderItem}
+ placeholderData={{
+ heading: 'Your Favorites',
+ paragraph: 'You have not added any notes to favorites yet.',
+ button: null,
+ }}
placeholder={<Placeholder type="trash" />}
placeholderText="Deleted notes & notebooks appear here."
/>
- <ContainerBottomButton
- title="Clear all trash"
- onPress={_onPressBottomButton}
- />
+ {trash && trash.length !== 0 && (
+ <ContainerBottomButton
+ title="Clear all trash"
+ onPress={_onPressBottomButton}
+ />
+ )}
</>
);
};