@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
40 lines (39 loc) • 1.08 kB
JavaScript
;
import React from "react";
import { StyledText, StyledView } from "../StyledComponents/index.js";
import { verticalScale } from "../../helpers/ResponsiveCalculations.js";
import { useTheme } from "../../hooks/index.js";
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
const AvatarText = ({
size = 70,
fs,
text = 'YH',
bg,
containerStyle,
textStyle
}) => {
text = text.slice(0, 2).toUpperCase();
const theme = useTheme();
return /*#__PURE__*/_jsx(_Fragment, {
children: /*#__PURE__*/_jsx(StyledView, {
bg: bg ?? theme.colors.primary
// alignSelf='flex-start'
,
h: verticalScale(size),
w: verticalScale(size),
align: "center",
justify: "center",
borderRadius: verticalScale(size),
style: containerStyle,
children: /*#__PURE__*/_jsx(StyledText, {
secondary: true,
fw: "bold",
fs: fs ?? size / 3,
style: textStyle,
children: text
})
})
});
};
export default AvatarText;
//# sourceMappingURL=AvatarText.js.map