mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
implement new tag api
This commit is contained in:
@@ -301,7 +301,7 @@ export const Menu = ({
|
||||
marginBottom: 0,
|
||||
}}>
|
||||
{tags
|
||||
.filter(o => o.count > 1)
|
||||
.filter(o => o.noteIds.length > 1)
|
||||
.slice(0, tags.length > 10 ? 10 : tags.length)
|
||||
.map(item => (
|
||||
<TouchableOpacity
|
||||
@@ -342,7 +342,7 @@ export const Menu = ({
|
||||
}}>
|
||||
{item.title + ' '}
|
||||
</Text>
|
||||
{item.count > 1 ? (
|
||||
{item.noteIds.length > 1 ? (
|
||||
<Text
|
||||
style={{
|
||||
color: 'white',
|
||||
@@ -355,7 +355,7 @@ export const Menu = ({
|
||||
padding: 0,
|
||||
paddingHorizontal: 1,
|
||||
}}>
|
||||
{item.count > 99 ? '99+' : item.count}
|
||||
{item.noteIds.length > 99 ? '99+' : item.noteIds.length}
|
||||
</Text>
|
||||
) : null}
|
||||
</TouchableOpacity>
|
||||
|
||||
@@ -181,7 +181,7 @@ const SimpleList = ({
|
||||
);
|
||||
|
||||
const _listKeyExtractor = (item, index) =>
|
||||
item.dateCreated.toString() + index.toString();
|
||||
item.id.toString() + index.toString();
|
||||
|
||||
return (
|
||||
<FlatList
|
||||
|
||||
@@ -8,6 +8,7 @@ import SimpleList from '../../components/SimpleList';
|
||||
import {useTracked} from '../../provider';
|
||||
import {ACTIONS} from '../../provider/actions';
|
||||
import NavigationService from '../../services/NavigationService';
|
||||
import {db} from '../../utils/utils';
|
||||
|
||||
const w = Dimensions.get('window').width;
|
||||
const h = Dimensions.get('window').height;
|
||||
@@ -69,10 +70,10 @@ export const Tags = ({navigation}) => {
|
||||
fontSize: SIZE.xs,
|
||||
color: colors.icon,
|
||||
}}>
|
||||
{item && item.count && item.count > 1
|
||||
? item.count + ' notes'
|
||||
: item.count === 1
|
||||
? item.count + ' note'
|
||||
{item && item.noteIds.length && item.noteIds.length > 1
|
||||
? item.noteIds.length + ' notes'
|
||||
: item.noteIds.length === 1
|
||||
? item.noteIds.length + ' note'
|
||||
: null}
|
||||
</Text>
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user