UNPKG

@nexara/nativeflow

Version:

Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.

45 lines (44 loc) 1.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _index = require("../StyledComponents/index.js"); var _ResponsiveCalculations = require("../../helpers/ResponsiveCalculations.js"); var _index2 = require("../../hooks/index.js"); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } const AvatarText = ({ size = 70, fs, text = 'YH', bg, containerStyle, textStyle }) => { text = text.slice(0, 2).toUpperCase(); const theme = (0, _index2.useTheme)(); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, { children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.StyledView, { bg: bg ?? theme.colors.primary // alignSelf='flex-start' , h: (0, _ResponsiveCalculations.verticalScale)(size), w: (0, _ResponsiveCalculations.verticalScale)(size), align: "center", justify: "center", borderRadius: (0, _ResponsiveCalculations.verticalScale)(size), style: containerStyle, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.StyledText, { secondary: true, fw: "bold", fs: fs ?? size / 3, style: textStyle, children: text }) }) }); }; var _default = exports.default = AvatarText; //# sourceMappingURL=AvatarText.js.map