mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
hide options from ActionSheet
This commit is contained in:
@@ -50,8 +50,8 @@ export const ActionSheetComponent = ({
|
|||||||
favorite: false,
|
favorite: false,
|
||||||
locked: false,
|
locked: false,
|
||||||
content: {
|
content: {
|
||||||
text: '',
|
text: null,
|
||||||
delta: {},
|
delta: null,
|
||||||
},
|
},
|
||||||
dateCreated: null,
|
dateCreated: null,
|
||||||
},
|
},
|
||||||
@@ -419,7 +419,8 @@ export const ActionSheetComponent = ({
|
|||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
const _renderColumnItem = item =>
|
const _renderColumnItem = item =>
|
||||||
columnItems.includes(item.name) ? (
|
(note.dateCreated && columnItems.includes(item.name)) ||
|
||||||
|
item.name === 'Dark Mode' ? (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={item.name}
|
key={item.name}
|
||||||
activeOpacity={opacity}
|
activeOpacity={opacity}
|
||||||
@@ -497,6 +498,20 @@ export const ActionSheetComponent = ({
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
paddingHorizontal: 0,
|
paddingHorizontal: 0,
|
||||||
}}>
|
}}>
|
||||||
|
{!note.dateCreated ? (
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
textAlign: 'center',
|
||||||
|
marginVertical: 10,
|
||||||
|
color: colors.icon,
|
||||||
|
fontFamily: WEIGHT.regular,
|
||||||
|
}}>
|
||||||
|
Please start writing to save your note.
|
||||||
|
</Text>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{note.dateCreated ? (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
@@ -509,8 +524,9 @@ export const ActionSheetComponent = ({
|
|||||||
}}>
|
}}>
|
||||||
{rowItemsData.map(_renderRowItem)}
|
{rowItemsData.map(_renderRowItem)}
|
||||||
</View>
|
</View>
|
||||||
|
) : null}
|
||||||
|
|
||||||
{hasColors ? (
|
{hasColors && note.dateCreated ? (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -527,7 +543,7 @@ export const ActionSheetComponent = ({
|
|||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{hasTags ? (
|
{hasTags && note.dateCreated ? (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
|||||||
@@ -450,11 +450,16 @@ const Editor = ({navigation, noMenu}) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let handleBack;
|
let handleBack;
|
||||||
if (!noMenu) {
|
if (!noMenu && DDS.isTab) {
|
||||||
handleBack = BackHandler.addEventListener('hardwareBackPress', () => {
|
handleBack = BackHandler.addEventListener('hardwareBackPress', () => {
|
||||||
simpleDialogEvent(TEMPLATE_EXIT_FULLSCREEN());
|
simpleDialogEvent(TEMPLATE_EXIT_FULLSCREEN());
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
} else if (noMenu && !DDS.isTab) {
|
||||||
|
handleBack = BackHandler.addEventListener('hardwareBackPress', () => {
|
||||||
|
simpleDialogEvent(TEMPLATE_EXIT());
|
||||||
|
return true;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (handleBack) {
|
if (handleBack) {
|
||||||
handleBack.remove();
|
handleBack.remove();
|
||||||
@@ -469,6 +474,7 @@ const Editor = ({navigation, noMenu}) => {
|
|||||||
}
|
}
|
||||||
title = null;
|
title = null;
|
||||||
content = null;
|
content = null;
|
||||||
|
timestamp = null;
|
||||||
timer = null;
|
timer = null;
|
||||||
};
|
};
|
||||||
}, [noMenu]);
|
}, [noMenu]);
|
||||||
|
|||||||
Reference in New Issue
Block a user