feat(mobile): Avatar + ConversationRow + relative-time helper

This commit is contained in:
byGalax
2026-05-13 23:59:53 +02:00
parent 3313dd84f3
commit 0b3a6280fc
3 changed files with 99 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { StyleSheet, Text, View } from 'react-native';
import { colors } from '../theme/colors';
// Initial-letter avatar circle. Phase 2 will swap in an image-aware
// version that prefers profile.avatarUrl when present.
export function Avatar({ name, size = 40 }: { name: string; size?: number }) {
const letter = (name.trim().charAt(0) || '?').toUpperCase();
return (
<View style={[styles.circle, { width: size, height: size, borderRadius: size / 2 }]}>
<Text style={[styles.letter, { fontSize: size * 0.45 }]}>{letter}</Text>
</View>
);
}
const styles = StyleSheet.create({
circle: {
backgroundColor: colors.accentMuted,
alignItems: 'center',
justifyContent: 'center',
},
letter: { color: colors.accent, fontWeight: '700' },
});