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