adjust styles

This commit is contained in:
Hailey
2024-05-01 17:53:22 -07:00
parent 2d3b90be03
commit 773ad8f03d
@@ -65,45 +65,46 @@ export function MessageItem({
}, [control, playHaptic]) }, [control, playHaptic])
return ( return (
<GrowWrapper onOpenMenu={onOpenMenu} ref={itemRef}> <View
<View style={{maxWidth: '65%', marginLeft: isFromSelf ? 'auto' : undefined}}>
style={[ <GrowWrapper onOpenMenu={onOpenMenu} ref={itemRef}>
a.py_sm, <View
a.px_lg,
a.my_2xs,
a.rounded_md,
isFromSelf ? a.self_end : a.self_start,
{
maxWidth: '65%',
backgroundColor: isFromSelf
? t.palette.primary_500
: t.palette.contrast_50,
borderRadius: 17,
},
isFromSelf
? {borderBottomRightRadius: isLastInGroup ? 2 : 17}
: {borderBottomLeftRadius: isLastInGroup ? 2 : 17},
]}>
<Text
style={[ style={[
a.text_md, a.py_sm,
a.leading_snug, a.px_lg,
isFromSelf && {color: t.palette.white}, a.my_2xs,
a.rounded_md,
{
backgroundColor: isFromSelf
? t.palette.primary_500
: t.palette.contrast_50,
borderRadius: 17,
},
isFromSelf
? {borderBottomRightRadius: isLastInGroup ? 2 : 17}
: {borderBottomLeftRadius: isLastInGroup ? 2 : 17},
]}> ]}>
{item.text} <Text
</Text> style={[
</View> a.text_md,
<Metadata a.leading_snug,
message={item} isFromSelf && {color: t.palette.white},
isLastInGroup={isLastInGroup} ]}>
style={isFromSelf ? a.text_right : a.text_left} {item.text}
/> </Text>
<MessageMenu </View>
message={item} <Metadata
onClose={() => itemRef.current?.reset()} message={item}
control={control} isLastInGroup={isLastInGroup}
/> style={isFromSelf ? a.text_right : a.text_left}
</GrowWrapper> />
<MessageMenu
message={item}
onClose={() => itemRef.current?.reset()}
control={control}
/>
</GrowWrapper>
</View>
) )
} }