managarten/picture/apps/mobile/components/Icon.tsx
Till-JS c712a2504a feat: integrate uload and picture, unify package naming
- Add uload project with apps/web structure
  - Reorganize from flat to monorepo structure
  - Remove PocketBase binary and local data
  - Update to pnpm and @uload/web namespace

- Add picture project to monorepo
  - Remove embedded git repository

- Unify all package names to @{project}/{app} schema:
  - @maerchenzauber/* (was @storyteller/*)
  - @manacore/* (was manacore-*, manacore)
  - @manadeck/* (was web, backend, manadeck)
  - @memoro/* (was memoro-web, landing, memoro)
  - @picture/* (already unified)
  - @uload/web

- Add convenient dev scripts for all apps:
  - pnpm dev:{project}:web
  - pnpm dev:{project}:landing
  - pnpm dev:{project}:mobile
  - pnpm dev:{project}:backend

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 04:00:36 +01:00

134 lines
3.3 KiB
TypeScript

import { Platform } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { SymbolView, SFSymbol } from 'expo-symbols';
type IconProps = {
name: string;
size?: number;
color?: string;
weight?: 'regular' | 'medium' | 'semibold' | 'bold';
style?: any;
};
// Icon mapping: Ionicons name -> SF Symbol name
const iconMap: Record<string, string> = {
// Navigation
'chevron-back': 'chevron.left',
'chevron-forward': 'chevron.right',
'chevron-up': 'chevron.up',
'chevron-down': 'chevron.down',
'arrow-back': 'arrow.left',
'arrow-forward': 'arrow.right',
'close': 'xmark',
'menu': 'line.3.horizontal',
// Actions
'add': 'plus',
'remove': 'minus',
'checkmark': 'checkmark',
'close-circle': 'xmark.circle.fill',
'search': 'magnifyingglass',
'filter': 'line.3.horizontal.decrease.circle',
'settings': 'gearshape',
'trash': 'trash',
'pencil': 'pencil',
'create': 'square.and.pencil',
'save': 'square.and.arrow.down',
'share': 'square.and.arrow.up',
'refresh': 'arrow.clockwise',
// Media & Content
'image': 'photo',
'images': 'photo.stack',
'camera': 'camera',
'heart': 'heart.fill',
'heart-outline': 'heart',
'star': 'star.fill',
'star-outline': 'star',
'bookmark': 'bookmark.fill',
'bookmark-outline': 'bookmark',
// Communication
'send': 'paperplane.fill',
'mail': 'envelope',
'notifications': 'bell',
'notifications-outline': 'bell',
// UI Elements
'ellipsis-vertical': 'ellipsis',
'ellipsis-horizontal': 'ellipsis',
'grid': 'square.grid.2x2',
'list': 'list.bullet',
'eye': 'eye',
'eye-off': 'eye.slash',
'information-circle': 'info.circle',
'warning': 'exclamationmark.triangle',
// People & Places
'person': 'person.fill',
'person-outline': 'person',
'person-circle': 'person.circle.fill',
'person-circle-outline': 'person.circle',
'people': 'person.2.fill',
'location': 'location.fill',
'home': 'house.fill',
'home-outline': 'house',
// Time & Calendar
'time': 'clock',
'calendar': 'calendar',
'today': 'calendar.badge.clock',
// Files & Folders
'document': 'doc.fill',
'document-outline': 'doc',
'folder': 'folder.fill',
'folder-outline': 'folder',
'download': 'arrow.down.circle',
'cloud-download': 'cloud.fill',
// Misc
'lock-closed': 'lock.fill',
'lock-open': 'lock.open.fill',
'key': 'key.fill',
'shield': 'shield.fill',
'flame': 'flame.fill',
'sparkles': 'sparkles',
'layers': 'square.stack.3d.up.fill',
'layers-outline': 'square.stack.3d.up',
'tag': 'tag.fill',
'pricetag': 'tag.fill',
'paintbrush': 'paintbrush.fill',
'color-palette': 'paintpalette.fill',
};
export function Icon({ name, size = 24, color = '#000', weight = 'regular', style }: IconProps) {
// Use SF Symbols on iOS, Ionicons elsewhere
if (Platform.OS === 'ios') {
const sfSymbolName = iconMap[name] || name;
// Map weights to SF Symbol weights
const sfWeight: 'regular' | 'medium' | 'semibold' | 'bold' = weight;
return (
<SymbolView
name={sfSymbolName as SFSymbol}
size={size}
tintColor={color}
weight={sfWeight}
style={style}
resizeMode="scaleAspectFit"
/>
);
}
// Fallback to Ionicons on Android/Web
return (
<Ionicons
name={name as any}
size={size}
color={color}
style={style}
/>
);
}