Simplify SetItem

It had a pointless react fragment
wrapping it's only element.
This commit is contained in:
Brandon Presley 2023-07-07 13:41:48 +12:00
parent 09354829a8
commit 1b2cbab370
1 changed files with 28 additions and 30 deletions

View File

@ -43,36 +43,34 @@ export default function SetItem({
}, [dark, ids, item.id]) }, [dark, ids, item.id])
return ( return (
<> <List.Item
<List.Item onPress={press}
onPress={press} title={item.name}
title={item.name} description={`${item.reps} x ${item.weight}${item.unit || 'kg'}`}
description={`${item.reps} x ${item.weight}${item.unit || 'kg'}`} onLongPress={longPress}
onLongPress={longPress} style={{ backgroundColor }}
style={{ backgroundColor }} left={() =>
left={() => settings.images &&
settings.images && item.image && (
item.image && ( <Image
<Image source={{ uri: item.image }}
source={{ uri: item.image }} style={{ height: 75, width: 75 }}
style={{ height: 75, width: 75 }} />
/>
)}
right={() => (
<>
{settings.showDate && (
<Text
style={{
alignSelf: 'center',
color: dark ? '#909090ff' : '#717171ff',
}}
>
{format(new Date(item.created), settings.date || 'P')}
</Text>
)}
</>
)} )}
/> right={() => (
</> <>
{settings.showDate && (
<Text
style={{
alignSelf: 'center',
color: dark ? '#909090ff' : '#717171ff',
}}
>
{format(new Date(item.created), settings.date || 'P')}
</Text>
)}
</>
)}
/>
) )
} }