managarten/games/figgos/components/TabBarIcon.tsx
Till-JS 949b9c85bc 🎮 feat(games): add figgos game to monorepo
- Rename barbiebox to figgos and integrate into monorepo
- Remove separate git repository
- Update package name to @figgos/game
- Add dev scripts (figgos:dev, dev:figgos:ios, dev:figgos:android)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 16:26:25 +01:00

31 lines
1.1 KiB
TypeScript

import { Ionicons } from '@expo/vector-icons';
import { StyleSheet, Platform } from 'react-native';
import { useTheme } from '~/utils/ThemeContext';
// Mapping von Icon-Namen für verschiedene Plattformen
const iconMap: Record<string, { ios: string; android: string }> = {
community: { ios: 'people', android: 'people' },
create: { ios: 'add-circle', android: 'add-circle' },
shelf: { ios: 'grid', android: 'grid' },
};
export const TabBarIcon = (props: { name: string; color: string; focused?: boolean }) => {
const { name, color, focused } = props;
// Wähle das richtige Icon basierend auf der Plattform
const mappedName = iconMap[name] || { ios: 'help-circle', android: 'help-circle' };
const iconName = Platform.OS === 'ios' ? mappedName.ios : mappedName.android;
// Bestimme den vollständigen Icon-Namen (mit oder ohne Outline)
const fullIconName = (
focused ? iconName : `${iconName}-outline`
) as keyof typeof Ionicons.glyphMap;
return <Ionicons name={fullIconName} size={26} style={styles.tabBarIcon} color={color} />;
};
export const styles = StyleSheet.create({
tabBarIcon: {
marginBottom: -3,
},
});