mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 11:49:39 +02:00
Projects included: - maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing) - manacore (Expo mobile + SvelteKit web + Astro landing) - manadeck (NestJS backend + Expo mobile + SvelteKit web) - memoro (Expo mobile + SvelteKit web + Astro landing) This commit preserves the current state before monorepo restructuring. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
40 lines
964 B
TypeScript
40 lines
964 B
TypeScript
import React from 'react';
|
|
import { FontAwesome, Ionicons, MaterialIcons, Feather } from '@expo/vector-icons';
|
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
|
|
type IconLibrary = 'FontAwesome' | 'Ionicons' | 'MaterialIcons' | 'Feather';
|
|
|
|
interface IconProps {
|
|
name: string;
|
|
size?: number;
|
|
color?: string;
|
|
library?: IconLibrary;
|
|
className?: string;
|
|
style?: StyleProp<ViewStyle>;
|
|
}
|
|
|
|
export const Icon: React.FC<IconProps> = ({
|
|
name,
|
|
size = 24,
|
|
color,
|
|
library = 'FontAwesome',
|
|
...props
|
|
}) => {
|
|
const iconProps = {
|
|
size,
|
|
color,
|
|
...props,
|
|
};
|
|
|
|
switch (library) {
|
|
case 'Ionicons':
|
|
return <Ionicons name={name as any} {...iconProps} />;
|
|
case 'MaterialIcons':
|
|
return <MaterialIcons name={name as any} {...iconProps} />;
|
|
case 'Feather':
|
|
return <Feather name={name as any} {...iconProps} />;
|
|
case 'FontAwesome':
|
|
default:
|
|
return <FontAwesome name={name as any} {...iconProps} />;
|
|
}
|
|
};
|