diff --git a/apps/mobile/src/components/Avatar.tsx b/apps/mobile/src/components/Avatar.tsx index 8a0ee0c8..b5d1fb0e 100644 --- a/apps/mobile/src/components/Avatar.tsx +++ b/apps/mobile/src/components/Avatar.tsx @@ -10,7 +10,7 @@ type Props = { }; export const Avatar: React.FC = ({ uri, name = 'D', size = 56, style }) => { - const initials = name.charAt(0).toUpperCase(); + const initials = name[0].toUpperCase(); const imageStyle = [{ width: size, height: size, borderRadius: size / 2 } as ImageStyle, style as ImageStyle]; const placeholderStyle = [{ width: size, height: size, borderRadius: size / 2, backgroundColor: COLORS.primary }, style as ViewStyle]; diff --git a/apps/mobile/src/screens/DevCardViewScreen.tsx b/apps/mobile/src/screens/DevCardViewScreen.tsx index 3698c862..99a28b77 100644 --- a/apps/mobile/src/screens/DevCardViewScreen.tsx +++ b/apps/mobile/src/screens/DevCardViewScreen.tsx @@ -415,7 +415,7 @@ export default function DevCardViewScreen({ navigation, route }: Props) { description="This DevCard profile does not have any platform links available." /> - ) : profile.links.map(link => { + ) : profile.(links ?? []).map(link => { const platform = PLATFORMS[link.platform]; const state = followStates[link.id] || 'idle'; const btnColor = getButtonColor(link, state); @@ -453,7 +453,7 @@ export default function DevCardViewScreen({ navigation, route }: Props) { ) : ( - {PLATFORM_EMOJI[link.platform] || platform?.name.charAt(0) || '?'} + {PLATFORM_EMOJI[link.platform] || platform?.name[0] || '?'} )} diff --git a/apps/web/src/pages/CardPage.tsx b/apps/web/src/pages/CardPage.tsx index 690ce574..1b6ddf82 100644 --- a/apps/web/src/pages/CardPage.tsx +++ b/apps/web/src/pages/CardPage.tsx @@ -104,7 +104,7 @@ export default function CardPage() { className="card-avatar-placeholder" style={{ background: card.owner.accentColor || '#6366F1' }} > - {card.owner.displayName.charAt(0).toUpperCase()} + {card.owner.displayName[0].toUpperCase()} )} @@ -134,7 +134,7 @@ export default function CardPage() {

Connections

- {card.links.map((link) => ( + {card.(links ?? []).map((link) => (