@oxyhq/services
Version:
Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀
61 lines • 1.61 kB
TypeScript
import type React from 'react';
import { type StyleProp, type ViewStyle, type ImageStyle, type TextStyle } from 'react-native';
export interface AvatarProps {
/**
* URL of the avatar image
*/
uri?: string;
/**
* Text to display when no image is available
* Defaults to first letter of name if name is provided
*/
text?: string;
/**
* Full name to derive the initials from
* For single word: takes first letter
* For multiple words: takes first letter of first and last word (e.g., "John Doe" -> "JD")
* For usernames starting with @: takes first two letters after @
*/
name?: string;
/**
* Size of the avatar in pixels
* @default 40
*/
size?: number;
/**
* Theme to use for colors
* @default 'light'
*/
theme?: 'light' | 'dark';
/**
* Background color for text avatar
* Defaults to theme primary color
*/
backgroundColor?: string;
/**
* Text color for text avatar
* @default '#FFFFFF'
*/
textColor?: string;
/**
* Additional styles for the container
*/
style?: StyleProp<ViewStyle>;
/**
* Additional styles for the image
* Only used when uri is provided
*/
imageStyle?: StyleProp<ImageStyle>;
/**
* Additional styles for the text
*/
textStyle?: StyleProp<TextStyle>;
/**
* Is loading state
* @default false
*/
isLoading?: boolean;
}
declare const _default: React.NamedExoticComponent<AvatarProps>;
export default _default;
//# sourceMappingURL=Avatar.d.ts.map