mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
add suggestions
This commit is contained in:
@@ -40,7 +40,7 @@ export const ActionSheetComponent = ({
|
|||||||
columnItems = [],
|
columnItems = [],
|
||||||
}) => {
|
}) => {
|
||||||
const [state, dispatch] = useTracked();
|
const [state, dispatch] = useTracked();
|
||||||
const {colors} = state;
|
const {colors, tags} = state;
|
||||||
const [focused, setFocused] = useState(false);
|
const [focused, setFocused] = useState(false);
|
||||||
const [note, setNote] = useState(
|
const [note, setNote] = useState(
|
||||||
item
|
item
|
||||||
@@ -107,7 +107,7 @@ export const ActionSheetComponent = ({
|
|||||||
let tagInputValue = note.tags[note.tags.length - 1];
|
let tagInputValue = note.tags[note.tags.length - 1];
|
||||||
let oldProps = {...note};
|
let oldProps = {...note};
|
||||||
if (oldProps.tags.length === 0) return;
|
if (oldProps.tags.length === 0) return;
|
||||||
//oldProps.tags.splice(oldProps.tags.length - 1);
|
|
||||||
await db.notes
|
await db.notes
|
||||||
.note(note.id)
|
.note(note.id)
|
||||||
.untag(oldProps.tags[oldProps.tags.length - 1]);
|
.untag(oldProps.tags[oldProps.tags.length - 1]);
|
||||||
@@ -117,10 +117,6 @@ export const ActionSheetComponent = ({
|
|||||||
tagsInputRef.setNativeProps({
|
tagsInputRef.setNativeProps({
|
||||||
text: tagInputValue,
|
text: tagInputValue,
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
//tagsInputRef.focus();
|
|
||||||
}, 300);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -218,7 +214,8 @@ export const ActionSheetComponent = ({
|
|||||||
name: 'Restore',
|
name: 'Restore',
|
||||||
icon: 'trash',
|
icon: 'trash',
|
||||||
func: () => {
|
func: () => {
|
||||||
db.restoreItem(item.dateCreated);
|
// TODO
|
||||||
|
//db.restoreItem(item.dateCreated);
|
||||||
ToastEvent.show(
|
ToastEvent.show(
|
||||||
item.type === 'note' ? 'Note restored' : 'Notebook restored',
|
item.type === 'note' ? 'Note restored' : 'Notebook restored',
|
||||||
'success',
|
'success',
|
||||||
@@ -712,37 +709,39 @@ export const ActionSheetComponent = ({
|
|||||||
}}>
|
}}>
|
||||||
Suggestions:{' '}
|
Suggestions:{' '}
|
||||||
</Text>
|
</Text>
|
||||||
{['Notes', 'Nook'].map(tag => (
|
{tags
|
||||||
<TouchableOpacity
|
.filter(o => o.count > 1)
|
||||||
key={tag}
|
.map(tag => (
|
||||||
onPress={async () => {}}
|
<TouchableOpacity
|
||||||
style={{
|
key={tag}
|
||||||
flexDirection: 'row',
|
onPress={async () => {}}
|
||||||
justifyContent: 'flex-start',
|
|
||||||
alignItems: 'center',
|
|
||||||
margin: 1,
|
|
||||||
marginRight: 3,
|
|
||||||
paddingHorizontal: 5,
|
|
||||||
paddingVertical: 1,
|
|
||||||
backgroundColor: colors.shade,
|
|
||||||
borderRadius: 2.5,
|
|
||||||
}}>
|
|
||||||
<Text
|
|
||||||
style={{
|
style={{
|
||||||
fontFamily: WEIGHT.regular,
|
flexDirection: 'row',
|
||||||
fontSize: SIZE.xs,
|
justifyContent: 'flex-start',
|
||||||
color: colors.pri,
|
alignItems: 'center',
|
||||||
|
margin: 1,
|
||||||
|
marginRight: 3,
|
||||||
|
paddingHorizontal: 5,
|
||||||
|
paddingVertical: 1,
|
||||||
|
backgroundColor: colors.shade,
|
||||||
|
borderRadius: 2.5,
|
||||||
}}>
|
}}>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
color: colors.accent,
|
fontFamily: WEIGHT.regular,
|
||||||
|
fontSize: SIZE.xs,
|
||||||
|
color: colors.pri,
|
||||||
}}>
|
}}>
|
||||||
#
|
<Text
|
||||||
|
style={{
|
||||||
|
color: colors.accent,
|
||||||
|
}}>
|
||||||
|
#
|
||||||
|
</Text>
|
||||||
|
{tag.title}
|
||||||
</Text>
|
</Text>
|
||||||
{tag}
|
</TouchableOpacity>
|
||||||
</Text>
|
))}
|
||||||
</TouchableOpacity>
|
|
||||||
))}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ const Editor = ({navigation, noMenu}) => {
|
|||||||
post('clear');
|
post('clear');
|
||||||
} else if (note.content.delta) {
|
} else if (note.content.delta) {
|
||||||
let delta = await db.notes.note(id).delta();
|
let delta = await db.notes.note(id).delta();
|
||||||
console.log(delta);
|
|
||||||
post(JSON.stringify(delta));
|
post(JSON.stringify(delta));
|
||||||
} else {
|
} else {
|
||||||
post(JSON.stringify({type: 'text', value: note.content.text}));
|
post(JSON.stringify({type: 'text', value: note.content.text}));
|
||||||
|
|||||||
Reference in New Issue
Block a user