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])
return (
<>
<List.Item
onPress={press}
title={item.name}
description={`${item.reps} x ${item.weight}${item.unit || 'kg'}`}
onLongPress={longPress}
style={{ backgroundColor }}
left={() =>
settings.images &&
item.image && (
<Image
source={{ uri: item.image }}
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>
)}
</>
<List.Item
onPress={press}
title={item.name}
description={`${item.reps} x ${item.weight}${item.unit || 'kg'}`}
onLongPress={longPress}
style={{ backgroundColor }}
left={() =>
settings.images &&
item.image && (
<Image
source={{ uri: item.image }}
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>
)}
</>
)}
/>
)
}