- Created new Expo app with SDK 54+ and Expo Router - Installed and configured NativeWind v5 for Tailwind styling - Upgraded voice-assistant to React 19 for consistency - Kept voice-mobile outside workspace to avoid Metro bundler conflicts - Disabled React Compiler experimental feature for stability Setup includes: - postcss.config.mjs with Tailwind PostCSS plugin - global.css with Tailwind and NativeWind imports - metro.config.js with NativeWind wrapper - lightningcss pinned to 1.30.1 for stability Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
// Fallback for using MaterialIcons on Android and web.
|
|
|
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
|
import { SymbolWeight, SymbolViewProps } from 'expo-symbols';
|
|
import { ComponentProps } from 'react';
|
|
import { OpaqueColorValue, type StyleProp, type TextStyle } from 'react-native';
|
|
|
|
type IconMapping = Record<SymbolViewProps['name'], ComponentProps<typeof MaterialIcons>['name']>;
|
|
type IconSymbolName = keyof typeof MAPPING;
|
|
|
|
/**
|
|
* Add your SF Symbols to Material Icons mappings here.
|
|
* - see Material Icons in the [Icons Directory](https://icons.expo.fyi).
|
|
* - see SF Symbols in the [SF Symbols](https://developer.apple.com/sf-symbols/) app.
|
|
*/
|
|
const MAPPING = {
|
|
'house.fill': 'home',
|
|
'paperplane.fill': 'send',
|
|
'chevron.left.forwardslash.chevron.right': 'code',
|
|
'chevron.right': 'chevron-right',
|
|
} as IconMapping;
|
|
|
|
/**
|
|
* An icon component that uses native SF Symbols on iOS, and Material Icons on Android and web.
|
|
* This ensures a consistent look across platforms, and optimal resource usage.
|
|
* Icon `name`s are based on SF Symbols and require manual mapping to Material Icons.
|
|
*/
|
|
export function IconSymbol({
|
|
name,
|
|
size = 24,
|
|
color,
|
|
style,
|
|
}: {
|
|
name: IconSymbolName;
|
|
size?: number;
|
|
color: string | OpaqueColorValue;
|
|
style?: StyleProp<TextStyle>;
|
|
weight?: SymbolWeight;
|
|
}) {
|
|
return <MaterialIcons color={color} size={size} name={MAPPING[name]} style={style} />;
|
|
}
|