26 lines
731 B
TypeScript
26 lines
731 B
TypeScript
// Cross-platform icon component using Ionicons for all platforms.
|
|
import Ionicons from "@expo/vector-icons/Ionicons";
|
|
import { ComponentProps } from "react";
|
|
import { OpaqueColorValue, StyleProp, TextStyle } from "react-native";
|
|
|
|
// Define the icon names we use in the app
|
|
export type IconSymbolName = ComponentProps<typeof Ionicons>["name"];
|
|
|
|
/**
|
|
* An icon component that uses Ionicons on all platforms.
|
|
*/
|
|
export function IconSymbol({
|
|
name,
|
|
size = 24,
|
|
color,
|
|
style,
|
|
}: {
|
|
name: IconSymbolName;
|
|
size?: number;
|
|
color: string | OpaqueColorValue;
|
|
style?: StyleProp<TextStyle>;
|
|
weight?: string; // Kept for compatibility but unused
|
|
}) {
|
|
return <Ionicons color={color} size={size} name={name} style={style} />;
|
|
}
|